467,074 Members | 975 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,074 developers. It's quick & easy.

100% width of div in IE

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
  • viewed: 13092
Share:
1 Reply
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.

Similar topics

2 posts views Thread by patrick h. | last post: by
5 posts views Thread by John Smith | last post: by
17 posts views Thread by Mike | last post: by
4 posts views Thread by reycri@gmail.com | last post: by
reply views Thread by Markus Olderdissen | last post: by
11 posts views Thread by yawnmoth | last post: by
1 post views Thread by psion | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.