100% height div with xhtml

J

Jeremy Chapman

If my page has a doc type tag of:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

How do I create a div that sizes it's height to 100% of the page?

For example:
<div style="height:100%"></div> will not size to fit the page height, but
if I remove the DOCTYPE tag or set it to something other than XHTML the div
will resize.
 
T

Trevor Benedict R

Use a Stylesheet and create a class or set the width for the div tag. That
should work. Moving forward this is the best time to clean up.

Regards,

Trevor Benedict R
MCSD
 
B

Bruce Barker

xhtml (or html 4.0) does not support this. there is no default height for a
page (unlike width). your div has to be contained inside an html object with
an absolute height.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top