0

div {
  background-color: #bada55;
  width: 475px;
  float: left;
  margin-left: 30px;
  height: 100%;
}

html,
body {
  height: 100%;
  min-height: 100%;
}
<div>
</div>

I have a div I want to extend to bottom of screen. I'm not sure why but this is not working for me:

div {
    background-color: #bada55;
    width: 475px;
    float: left;
    margin-left: 30px;
    height: 100%;
} 


html, body {
    height: 100%;
    min-height: 100%;
}
Temani Afif
  • 245,468
  • 26
  • 309
  • 415
AKaz20005
  • 25
  • 5

2 Answers2

0

Use this

html, body {
    height: 100%;
    min-height: 100%;
    margin: 0;
}
0

initialize margin & padding like *{margin: 0px; padding: 0px;}

div {
  background-color: #bada55;
  width: 475px;
  float: left;
  margin-left: 30px;
  height: 100%;
}

html,
body {
  height: 100%;
  min-height: 100%;
     
}
 *{
  margin: 0px;
    padding: 0px;
    }
    
<div>
</div>
rootShiv
  • 1,375
  • 2
  • 6
  • 21