IT Placement Papers Web Technologies CSS
This category contains CSS Interview Questions and Answers |
How do I make my div 100% height?
|
|
|
|
|
ou need to know what the 100% is of, so the parent div must have a height set. One problem that people often come up against is making the main page fill the screen if there's little content. You can do that like this :
CSS
body, html {
height:100%;
}
body {
margin:0;
padding:0;
}
#wrap {
position:relative;
min-height:100%;
}
* html #wrap {
height:100%;
}
Here, the #wrap div goes around your whole page - it's like a sub-body.
Only registered users can write comments. Please login or register.
|