OZONE Asylum
Forums
XML - XSL - XSLT - XHTML - CSS - DOM
100% of the containing element
This page's ID:
10869
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Okay.........grrr.... Is there some way to make a <div> actually apply a width of 100% of its containing element. [url=http://efs1.com/hfd/temp.htm]I have a test page that looks like this.[/url] The code looks like this... [code] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <style type="text/css" id="internal_style"> body { margin:0px; padding:0px; text-align:center; } #content { width:500px; height:100%; margin:0px auto; text-align:left; padding:0px; border:1px solid red; background-color:#EEEEEE; } </style> <title>Document Title</title> </head> <body> <div id="content"> Why this? Why me? </div> </body> </html> [/code] When viewed, each browser makes the <div> tag the minimum size needed to fit in the text inside. However, when there is no DTD included, all browsers actually make the <div> tag 100% of the window; this is not dependent on which DTD because I?ve tried them all. I don?t really want to remove the DTD just to make this work, but I most definitely will if I have to. And if I set the position of the <div> tag to absolute it will also make it 100% of the window, but then it?s no longer located in the ~center~ of the window. I know I could set the position to absolute and then use negative margins to center it horizontally but that method comes with a major flaw. When the <div> you?re trying to position is of any reasonable size and the user resizes the window the scrollbars only work for half of the <div> leaving the other half lost in negative land. Does anyone know a proper way to achieve this affect? Edit: Is anyone else having a hard time trying to get onto the GN site? :: ~Existence is a mere pattern.~ :: [This message has been edited by Rooster (edited 12-08-2002).]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »