Forum Moderators: not2easy

Message Too Old, No Replies

Image gallery, nested DIVs, floats, weird margins

DIVs edging outside of parent DIV (in IE)

         

Ernos

3:35 am on Jan 28, 2004 (gmt 0)

10+ Year Member



I've searched past threads looking for something similar to what I'm doing, and I've found a few, but they don't quite address the weird problem I'm having. I've got a page of thumbnails, and I've got each one in a DIV that's floated left (along with its caption). There's also JavaScript so that when you click a thumbnail a window pops up with the large image. This is my stylesheet (the important stuff, anyway):
body {margin:0; padding:0;}
DIV.links {position:absolute; top:100px; left:50px;}
BODY>DIV.links {position:fixed;}
.container {margin-left:320px;}
.body {border: thick solid red; margin:15px; padding:10px}
.floo {float:left; width:20%; margin:1%; padding:1%; text-align:center;}
.clear {clear:both; margin:0;}
The HTML is like so:
<BODY>
<DIV CLASS="links">Navbar here.</DIV>

<DIV CLASS="container">
<DIV CLASS="header">Header here.</DIV>
<DIV CLASS="body">
<P>Blah blah blah.

<DIV CLASS="floo"><A href="xyz" [[JavaScript here.]]><IMG SRC="xyz"></A><BR>Caption.</DIV>
<DIV CLASS="floo"><A href="xyz" [[JavaScript here.]]><IMG SRC="xyz"></A><BR>Caption.</DIV>
<DIV CLASS="floo"><A href="xyz" [[JavaScript here.]]><IMG SRC="xyz"></A><BR>Caption.</DIV>
[And so on, a pageful of DIVs.]

<P class="clear">Clearing paragraph.
</DIV></DIV></BODY>


This looks right in Mozilla, of course, but IE is being screwy as usual and I'm hoping someone can tell me a way to hack it back into shape. It's supposed to look like this (sorry about all the periods, the pre tag seems to ignore a lot of spaces):

¦--------------------------------¦
¦ .... ¦ ........header......... ¦
¦ .... ¦ ._____________________. ¦
¦ link ¦ ¦ Blah blah.......... ¦ ¦
¦ link ¦ ¦ .__. .__. .__. .__. ¦ ¦
¦ .... ¦ ¦ ¦__¦ ¦__¦ ¦__¦ ¦__¦ ¦ ¦
¦ .... ¦ ¦ cap. cap. cap. cap. ¦ ¦
¦ .... ¦ ¦ .__. .__. .__. .__. ¦ ¦
¦ .... ¦ ¦ ¦__¦ ¦__¦ ¦__¦ ¦__¦ ¦ ¦
¦ .... ¦ ¦ cap. cap. cap. cap. ¦ ¦
¦ .... ¦ ¦ Clearing paragraph. ¦ ¦
¦ .... ¦ ¦_____________________¦ ¦
¦ .... ¦ ....................... ¦
¦ .... ¦ ....................... ¦
¦--------------------------------¦

In IE6, the whole block of thumbnails is shifted slightly to the right, so it's slightly indented on the left and slightly overlapping the border of the "body" DIV on the right hand side of the page. It's very noticeable if you add a colored border to the "floo" (thumbnail) class in the stylesheet. Is there any way to fix this in IE without breaking it in Mozilla? I'd like to keep the same basic style if possible, so that if the window's resized, the thumbnails just shift down (to three columns or two or whatever).

yowza

3:50 am on Jan 28, 2004 (gmt 0)

10+ Year Member



You could use the _underscore hack.

If you do something like this:

.main {
position: relative;
top: -1px;
border-left-width: 1px;
border-left-style: solid;
border-left-color: #333300;
min-height: 444px;
_height: 444px;
left: 2px;
}

_height: 444px;

is only recognized by IE and ignored by the others.