My HTML:
div.container
My CSS:
html, body {
height: 100%;
background-color: red;
padding-left: 0px;
padding-right: 0px;
}
.container {
height: 100%;
background-color: blue;
margin-top: 5px;
*zoom: 1;
}
I want to use height=100% and DO NOT want to use overflow=hidden.
Which CSS properties I should use above so that I can have EFFECT OF margin-top for container div above which will not create vertical scroll-bar.
Just Imagine:
* Body with color red
* A div container in body and I want to see the margin of "x" px on top bewteen body and conatiner
* Color of div container blue
* No scrollbars and No overflow="hidden"
Please help
How can I accomplish this? Please help
Try this CSS
First reset all margin and padding.
box-sizing:border-box;means the size of an element will stay the same no matter how much padding you add to it.You could also use an absolute positioned div for the red bar.
HTML
CSS