i have markup like this:
<html>
<body>
<div class="page">
<div class="top_menu">
some text
</div>
<div class='header'>
menu
</div>
<div class="main">
<div class="left_sidebar">
left
</div>
<div class="content">
left
</div>
<div class="right_sidebar">
right
</div>
</div><!-- main div -->
</div> <!-- page div -->
</body>
</html>
I need to set block .main
to 100% page height, this is my css:
html {
height: 100%;
}
body {
height: 100%;
min-height: 100%;
margin: 0;
padding: 0;
}
.page {
height: 100%;
min-height: 100%;
background-color: white;
margin: 0 auto;
padding: 0;
width: 1084px;
}
.main {
width: 1084px;
height: 100%; // not working
}
.left_sidebar {
float: left;
max-width: 197px;
height: auto;
}
.content {
width: 517px;
float: left;
}
.right_sidebar {
width: 359px;
float: right;
}
Right now text inside .main
shown beyond the block and in Chrome i can see that width of this block is 1084 but height is 0. I know maybe this issue has already been asked, but i think i missed something.
Searched over internet tried this solution, did not worked for me
Use javascript to give height after on pageload
give id to div
And add this script before closing the body tag.
Combining your HTML and Body tags into one and removing min-height seems to fix it:
JSFiddle.
If you weren't wanting scrollbars you can use the CSS3
border-box
property and mess around with margins and padding, like so: new JSFiddle. This should work in all modern browsers (nothing below IE8.0).Try using this http://jsfiddle.net/7cZMh/2/
HTML
CSS
Oops, forgot this.