Welcome to the coding journey!!! In your css, add the following: box-sizing: border-box;

This will make your elements fit within the prescribed width and height.

html,body{
    width: 100%;
    height: 100%;
    margin: 0; /* Space from this element (entire page) and others*/
    padding: 0; /*space from content and border*/
    border: solid blue;
    border-width: thin;
    overflow:hidden;
    display:block;
    box-sizing: border-box;
}
<!DOCTYPE html>
    <html>
    <head>
        <title> Practice Webpage </title>
        <link href="stylesrevised.css" rel="stylesheet" type="text/css" >
    </head>

    <body></body>
    </html>
Answer from wlh on Stack Overflow
๐ŸŒ
W3Schools
w3schools.com โ€บ css โ€บ css_border.asp
CSS Borders
CSS Templates CSS Examples CSS Editor CSS Snippets CSS Quiz CSS Exercises CSS Website CSS Syllabus CSS Study Plan CSS Interview Prep CSS Bootcamp CSS Certificate ยท CSS Reference CSS Selectors CSS Combinators CSS Pseudo-classes CSS Pseudo-elements CSS At-rules CSS Functions CSS Reference Aural CSS Web Safe Fonts CSS Animatable CSS Units CSS PX-EM Converter CSS Colors CSS Color Values CSS Default Values CSS Browser Support ... The CSS border properties allow you to specify the style, width, and color of an element's border.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ html โ€บ how-to-add-border-in-html
How To Add Border In HTML? - GeeksforGeeks
July 23, 2025 - Example: In this example, the div element is given a 1-pixel solid gray border directly through the style attribute in the HTML tag. ... <!DOCTYPE html> <html> <body> <h1 style="color: green;">GeeksforGeeks</h1> <div style="border: 1px solid gray;"> This div has a gray border.
๐ŸŒ
HTML Dog
htmldog.com โ€บ guides โ€บ css โ€บ beginner โ€บ borders
Borders | HTML Dog
Borders can be applied to most HTML elements within the body. To make a border around an element, all you need is border-style. The values can be solid, dotted, dashed, double, groove, ridge, inset and outset.
๐ŸŒ
W3Schools
w3schools.com โ€บ jsref โ€บ prop_style_border.asp
HTML DOM Style border Property
The border property sets or returns up to three separate border properties, in a shorthand form. With this property, you can set/return one or more of the following (in any order): ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: [email protected] ยท If you want to report an error, or if you want to make a suggestion, send us an e-mail: [email protected] ยท HTML Tutorial CSS Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial
๐ŸŒ
CSS-Tricks
css-tricks.com โ€บ body-border
Creating a Body Border | CSS-Tricks
May 25, 2011 - Put transparent div over entire page which accomplishes border, but will cover content and make things unclickable. Pointer events means you can click through it. That belongs in CSS if you ask me. Iโ€™m down to hear a rebuttal though. Blog it! ... html { background: black; } body { margin: 10px; background: white; height:100%; position:relative; } #bar { width:100%; background: black; position:fixed; bottom:0; height:10px; }
๐ŸŒ
Quackit
quackit.com โ€บ html โ€บ codes โ€บ html_borders.cfm
HTML Borders
Using CSS, you can create a border around any HTML element. There are a range of CSS properties that you can use to define borders but the shorthand border property is the most concise way.
Find elsewhere
๐ŸŒ
Javatpoint
javatpoint.com โ€บ how-to-add-border-in-html
How to add border in Html - javatpoint
How to add border in Html with html tutorial, tags, anchor, img, div, entity, textarea, marquee, p tag, heading tag, h1, h2, table, formatting, attribute, elements, ol, ul, Input Types etc.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ html โ€บ how-to-set-a-border-for-an-html-div-tag
How to Set a Border for an HTML Div Tag ? - GeeksforGeeks
July 23, 2025 - Example: The below code will explain how you can add inline styles using style attribute. ... <!DOCTYPE html> <html> <head> <title> Inline Styles Example - GeeksforGeeks </title> </head> <body> <div style= "border: 2px dashed red; padding: 20px; text-align: center; max-width: 400px; margin: 0 auto;"> <p> This is a div with a red dashed border, styled using inline CSS.
๐ŸŒ
Sololearn
sololearn.com โ€บ en โ€บ Discuss โ€บ 2270999 โ€บ how-to-create-border-to-the-page
How to create border to the page? | Sololearn: Learn to code for FREE!
Katkar Shekhar Tanaji Delete everything in your css code and add these : body { border: 2px solid red; padding: 5px; } It will add a red border to the body.
๐ŸŒ
Computer Hope
computerhope.com โ€บ issues โ€บ ch001392.htm
How to Create a Colored Border Around Text with HTML and CSS
HTML tags can be formatted using a style attribute. To add a border using the style attribute, add the border CSS inside the quotes after style=.
๐ŸŒ
SheCodes
shecodes.io โ€บ athena โ€บ 9337-how-to-add-a-border-to-a-p-element-with-css
[CSS] - How to Add a Border to a Element with CSS - | SheCodes
Here's a guide on how to add a border to a element with the help of CSS. Learn how to adjust thickness, color and style of the border.
๐ŸŒ
freeCodeCamp
forum.freecodecamp.org โ€บ html-css
How to add the border - HTML-CSS - The freeCodeCamp Forum
January 27, 2024 - My work is at the right side, please how can I add the border with dark-blue color just like the one from freecodecamp
๐ŸŒ
Quora
quora.com โ€บ How-can-we-create-a-border-around-a-box-in-HTML-and-CSS
How can we create a border around a box in HTML and CSS? - Quora
Answer (1 of 3): imagine the box class is container. To create a border, use .container{ border:1px solid red } 1px represent the thickness number of the border
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ CSS โ€บ Reference โ€บ Properties โ€บ border
border - CSS | MDN
According to the spec, outlines don't have to be rectangular, although they usually are. border = <line-width> || <line-style> || <color> <line-width> = <length [0,โˆž]> | thin | medium | thick <line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ html โ€บ html-border-attribute
HTML border attribute - GeeksforGeeks
July 12, 2025 - Example 2: In this example, we will see code for Image border attribute in an HTML document. ... <!DOCTYPE html> <html> <head> <title> HTML img border Attribute </title> </head> <body> <h1>GeeksforGeeks</h1> <h2>HTML img border Attribute</h2> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20190506164011/logo3.png" alt="GeeksforGeeks logo" border="5"> </body> </html>