Sent by Tuttle Grey on 4 September 2002 03:03
>From: "Eric A. Meyer" [EMAIL-REMOVED]>
>To: [EMAIL-REMOVED]
>Subject: Re: [css-d] The mysterious adventures of Mozilla and The Black Box
>Date: Tue, 3 Sep 2002 16:29:44 -0400
>
>At 16:20 -0400 9/3/02, Scott Sauyet wrote:
>
>>On an incomplete personal web page (http://tinyurl.com/19zb) I've noticed
>>a strange effect in Mozilla browsers. When I hover over the main image,
>>a small black rectangle appears where the imagae would have been had I not
>>repositioned it.
>
> You need to float the link itself, not the image within it. By
>floating the image, you leave the inline link behind, so to speak. For that
>matter, it takes some special voodoo to prevent a loop condition to take
>effect in some cases, because when you float an element, it becomes
>block-level. When you have a block inside a link, you force-terminate the
>inline. So consider:
>
> <a href="big.html" id="biglink"><img src="blah"></a>
>
>... and then style it like this:
>
> a#main img {float: left;}
>
>So when you float the image, it becomes block-level and you get this DOM
>situation:
>
> <a></a> <img /> </a>
>
>...which means the image is no longer a descendant of the link (it
>forced-closed the inline) so it shouldn't float any more. That would
>return it to being a descendant of the link, so it floats, which takes it
>out, which unfloats it, repeat until crash.
> The moral of the story being, don't float elements out of inlines, and
>especially don't float things out of links. If you want your floated
>element to be a link, float the link that contains it instead.
Eric, I have on many pages floated images that are contained within links.
So I often have
<a href="big.html"><img class="right" src="blah"></a> and then styled with
IMG.right {float:right;}, or some other variant.
In spite of the fact that I've done those floated, linked images on many
pages, Scott's page is the first time I've see that behaviour in Moz/NN or
any browser.
Why have I not seen this before, on any of my pages? What you say is
interesting. I'm trying to figure out if I need to revisit my pages that
have floated images that are descendents of links, in order to change the
markup.
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx