My div will not stretch the full width of the browser, it stops short on both ends by about 10px.
.header {
position: relative;
background-color: #088ed7;
width: auto;
height: 20px;
}
<div class="header">...</div>
I've tried both auto
and 100%
but still get the same outcome.
It's likely the page's margin and/or padding.
Add:
html, body {
padding: 0;
margin: 0;
}
.header {
margin: 0;
}
html,
body {
padding: 0;
margin: 0;
}
.header {
margin: 0;
position: relative;
background-color: #088ed7;
width: auto;
height: 20px;
}
<div class="header">...</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With