0

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 ?

user979331
  • 11,039
  • 73
  • 223
  • 418

1 Answers1

2

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>
Paulie_D
  • 107,962
  • 13
  • 142
  • 161