Jump to content

Height 100%?


clbembry
 Share

Recommended Posts

Your div height of 100% needs to be inherited from its parents height. Otherwise what is it 100% of?I added the position:absolute to your style.css for body and it seemed to work. Try that.

body {position:absolute;height: 100%;padding: 0px;margin: 0px;font-family: tahoma;font-size: 12px;line-height: 150%;background-image: url(images/bembry-bg.jpg);background-repeat: repeat-x;background-color: #7a7a7a;color: white;}

For others who may be interested:A popular trick is to set the body height to 100% so that in turn will be inherited by the child div. Try this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><body style="position:absolute;height:100%;width:100%;margin:0;padding:0"><div style="background-color:lightyellow;height:100%">	Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam pede sapien, interdum et, vulputate sed, venenatis sed, erat. Fusce at enim id tellus cursus interdum. Phasellus ornare malesuada lorem. Morbi consectetuer mollis sem. Maecenas a arcu. Cras ullamcorper massa nec augue. Vestibulum in diam. Suspendisse nec nisl eget urna consectetuer egestas. Nulla eget nunc vitae pede varius vulputate. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Cras pulvinar. Nam id tortor ut sem sodales pharetra. Integer malesuada ipsum sed pede. Pellentesque metus lacus, rhoncus ac, ultrices pharetra, lobortis sed, eros. Curabitur id ligula sed velit pharetra ullamcorper. Nunc vehicula malesuada nunc. Integer dapibus. Etiam eros arcu, elementum a, laoreet a, porttitor et, velit. Suspendisse dignissim blandit sem.</div></html>

Link to comment
Share on other sites

Guest FirefoxRocks

You shouldn't need absolute positioning since there is nothing else outside of the body. Also, try setting whatever you set for the body to be html so:

body,html {height: 100%;padding:0px;margin:0px;font-family:Tahoma;font-size:12px;line-height:150%;background-image: url(images/bembry-bg.jpg);background-repeat:repeat-x;background-color:#7a7a7a;color:#fff}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...