I’m trying to get a div for content to basically run the entire height of a page between my header and my foot. If I use:
#content{ height: 100%; }
it only goes as high as the content I have within the div. Sometimes I may have only 1 sentence but want the div (with a background or border) to run the length of the screen until the footer which is only about 75px tall.
Is there a way to do this easy with CSS? Currently what I have is:
<style>
#content {
margin-top: 0px;
height: 800px;
width: 800px;
margin-left: auto;
margin-right: auto;
background-color: #E0E0E0 ;
}
</style>
</head>
<body>
<div id="content">
this is a div! with some centered crap
</div>
Add:
body, html { height:100% }and set the height of your content element toheight:100%as well.