By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,676 Members | 1,759 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,676 IT Pros & Developers. It's quick & easy.

100% width of div in IE

P: n/a
Hello,

I try to figure out, how I can define a div (using css) which is spread over
the whole page. The example below is how I think it should work, but when
using the Internet Explorer it doesn't work - the margin-left and
margin-right of the body is always subtracted from the width, and the div
is displayed in the top-left corner, but it does not fill the full
page-width - a white space on the right side (margin-left + marging-right)
of the body is shown (in IE and Opera). Mozilla, Firebird, Konqueror show
the div correctly.

div.full{
****position:*absolute;
****top:*0px;*left:*0px;*width:100%;*right:auto;
**}

Does anybody know a workaround for IE, or is it really impossible to set a
div to 100% width when the body contains a margin?

Greetings
--
Anita Meyer
an*********@aon.at
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
If you are talking about IE 5.5, that is how it works. There are hacks to
get around it. Look at http://glish.com/css/hacks.asp.

If you are just interested in IE6, you can use a doctype to make it stop
using "quirks mode" (IE5.5 compatibility) and force it into standards mode.
Look at http://www.hut.fi/~hsivonen/doctype.html.

--
--
Jim McMaster
mailto: ji**********@comcast.net
"Anita Meyer" <an*********@aon.at> wrote in message
news:40***********************@newsreader01.highwa y.telekom.at...
Hello,

I try to figure out, how I can define a div (using css) which is spread over the whole page. The example below is how I think it should work, but when
using the Internet Explorer it doesn't work - the margin-left and
margin-right of the body is always subtracted from the width, and the div
is displayed in the top-left corner, but it does not fill the full
page-width - a white space on the right side (margin-left + marging-right)
of the body is shown (in IE and Opera). Mozilla, Firebird, Konqueror show
the div correctly.

div.full{
position: absolute;
top: 0px; left: 0px; width:100%; right:auto;
}

Does anybody know a workaround for IE, or is it really impossible to set a
div to 100% width when the body contains a margin?

Greetings
--
Anita Meyer
an*********@aon.at

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.