Div 100% height

Soldato
Joined
27 Dec 2005
Posts
17,316
Location
Bristol
Having trouble with making a div 100% the height of the page when the content is longer than the viewing area.

Basically it stays set at the screen resolution height (ie. 768) rather than expanding when the text scrolls off the bottom. How is this achievable?
 
try adding this to your CSS:

Code:
body, html
{
     height:100%;
     padding:0;
     margin:0;
}
.test
{
     width:500px;
     height:100%;
}

Try putting a div with class="test" on your page and it should extend the full height of the browser.

Hmm - had a look at your site - looks like it fills the whole of the height to me, or do you just mean the sort of copyright notice/info at the bottom?

***Edit***

Scrub the code - I took a look at your css and saw you'd already got it there :)
 
Last edited:
as already said, you might have to apply the
Code:
height: 100%;
rule to the body and html elements

actually after looking at the site, it seems you might have an open div somewhere, I haven't actually got time to check the code properly but one I thing I have noticed is your break tags
Code:
<br />
get rid of them and wrap a paragraph element around them instead
Code:
<p></p>
 
Last edited:
Couldn't make sense of the easy clearing method (or get it to work) so just changed the image 'priorities' around. That is, I made the body background image the vertical white and created a div to span along the top with gradient as its background.
 
Back
Top Bottom