Reputation:
If you notice the main page of twitter has a div that always extends to the bottom of the page. I inspected the CSS and it looked like they where using
min-height:100%
However, this did not work when I tested it in a jsfiddle here
How do I create a div that always extends to the bottom of the page?
Upvotes: 1
Views: 57
Reputation: 16157
You can achieve this by using height:100%;
. Also note, height 100% needs to be set to the parent container. In this case html,body { }
If html,body { }
is not set to 100% then the container inside will only stretch 100% of it's container height.
html,body {
height:100%;
}
#all{
height: 100%;
background: #ff0000;
}
Upvotes: 1
Reputation: 5164
You'll also want to ensure that your body and html have 100% height as well.
html, body {
height: 100%;
}
Upvotes: 5