To achieve this task, it is necessary to reset your CSS styles.
For instance:
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
You do not have to adhere strictly to these rules; you can create custom CSS resets based on the specific elements you intend to use.
Now, let's examine the following HTML structure:
<html>
<head>
</head>
<style type="text/css">
html,body
{
margin:0px;
paddng:0px;
height:100%;
Width:100%;
background-color:black;
vertical-align: baseline;
}
#browserSize
{
color:White;
background-color:blue;
font-size:25px;
}
</style>
<body>
<div id="browserSize">
This fills up the entire browser window
</div>
</body>
</html>
You can save the above code in an HTML file and view it in a web browser.
In this example, I simply removed margins and paddings for the HTML and body elements,
allowing the main div (browserSize) to extend across the full width of the browser window.