Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / September 2003



Tip: Looking for answers? Try searching our database.

Positioning bug in IE

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Erik Funkenbusch - 23 Sep 2003 22:29 GMT
I've been tearing my hair out over this.  Can anyone suggest a workaround?

The following code *SHOULD* place the "test 2" text at the left margin of
the containing div, and the "test 3" text at a margin of 5em.  Instead,
it's positioning both divs at a 5em margin, which makes it difficult to use
absolute positioning for my nav bar.

It only does this when there is a margin set on a div within a non-static
parent div (or other block element I would assume).  It works fine if I
remove "outer".

The reason for the containing div is to give my navbar an edge to offset in
case the top div grows downward due to resizing.

Any suggestions for a workaround?  It works fine in Mozilla.

<html>
<head>
<style type="text/css">
<!--
#outer {position:relative;}
#two {position:absolute; left:0;}
#three {margin: 5em;}
-->
</style>
</head>

<body>
outside of the div
<div id="outer">
<div id="two">test 2</div>
<div id="three">test 3</div>
</div>
</body>
</html>
Marko Faldix - 26 Sep 2003 11:09 GMT
Hello,

[snip]

maybe this helps going ahead and gives further ideas, same result in IE 5.5,
Opera 7, NN 6.2. The contained div got the "relative", i.e. "relative to the
containing div". background-colors only for testing to make the divs
visible.

<html>
<head>
<style type="text/css">
<!--
   #outer {position:absolute; left: 50px; top: 50px; background-color:
yellow;}
   #two {position:relative; left:5px; top: 5px; background-color: red;}
   #three {margin: 5em;}
-->
</style>
</head>

<body>
   outside of the div

   <div id="outer">
       <div id="two">test 2</div>
       <div id="three">test 3</div>
   </div>

</body>
</html>

--
Marko Faldix
M+R Infosysteme
Hubert-Wienen-Str. 24     52070 Aachen
Tel.: 0241-93878-16     Fax.:0241-875095
E-Mail: marko.faldix@mplusr.de
Erik Funkenbusch - 26 Sep 2003 19:00 GMT
> maybe this helps going ahead and gives further ideas, same result in IE 5.5,
> Opera 7, NN 6.2. The contained div got the "relative", i.e. "relative to the
> containing div". background-colors only for testing to make the divs
> visible.

Thanks, but that won't work unfortunately.  I can't absolutely position
#outer because it's sole purpose is to adapt to the growth of the masthead
above it and provide an anchor to offset the navbar from in case the window
is resized and the content of the masthead grows downward.

Also, I can't use relative offsets to compensate because newer mozilla
browsers render it correctly and this would screw them up.

> <html>
> <head>
[quoted text clipped - 18 lines]
> </body>
> </html>
Marko Faldix - 29 Sep 2003 13:16 GMT
Hi,

[snip]
> Thanks, but that won't work unfortunately.  I can't absolutely position
> #outer because it's sole purpose is to adapt to the growth of the masthead
> above it and provide an anchor to offset the navbar from in case the window
> is resized and the content of the masthead grows downward.

#outers' absolute position is only chosen for example purpose. I think You
can do with #outer what ever you want.

[snip]

--
Marko Faldix
M+R Infosysteme
Hubert-Wienen-Str. 24     52070 Aachen
Tel.: 0241-93878-16     Fax.:0241-875095
E-Mail: marko.faldix@mplusr.de
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.