Reputation: 11841
I have a div like so:
<div class="background"></div>
and I am trying to give it 100% height so the background color is the whole div. Here is my CSS:
html, body {
height: 100%;
}
.background {
background-color: #1D3862;
clear: both;
height: 100%;
}
but its not working...what can I do to fix this ?
Upvotes: 0
Views: 2643
Reputation: 114991
You need to remove the default margin from the body
html, body {
height: 100%;
margin: 0;
}
html,
body {
height: 100%;
margin: 0;
}
.background {
background-color: #1D3862;
height: 100%;
}
<div class="background"></div>
Upvotes: 2