PDA

Click to See Complete Forum and Search --> : CSS Sticky: HTML Comments in IE


Ulysses
05-21-2005, 04:59 PM
The route of this problem annoyed me a long time ago on a large project, and I came accross it again today. Hopefully, it may save someone else's sanity:

Taken from http://www.positioniseverything.net/explorer/dup-characters.html

Internet Explorer 6 has a puzzling bug involving multiple floated elements; text characters from the last of the floated elements are sometimes duplicated below the last float. This bug is a real headbanger because there seems to be nothing triggering it. However, by now everyone should know that IE needs no excuse to misbehave.

The direct cause is nothing more than ordinary HTML comments, such as, <!-- end left column -->, sandwiched between floats that come in sequence. Apparently, the comments are hard for IE to digest when they occupy those positions, resulting in a kind of "screen diarrhea". HTML comments inside the floats do not cause the bug, nor do comments before or after the float series. Only comments residing between floats cause the bug.

The effect seen is that some of the last characters from the last floated element of the series are repeated outside and below that floated element. The first sandwiched comment does nothing unusual, but two comments cause the last two characters in that last float to repeat. Each additional comment makes two more characters join the party. It doesn't matter which pair of floats straddle the comments. In fact the two triggering comments may follow different floats as long as they have floats both before and after them.



My additional experience, is that html comments can also break up the flow of floated elements, particularly when using CSS to create stacked divs akin to rows in a table. The general effect is that the latter rows become irratic, and will not adhere to a sensicle stacking order, but rather produce vertical margins between rows, and even prevent child elements within the stacked divs from floating propely too. The outcome; a bloody mess.

EC
05-21-2005, 11:33 PM
whoa.

cool, thanks for the excellent tip. no way would I have ever been able to figure THAT out on my own!!

ecsyle
05-24-2005, 04:23 PM
Very cool. Thanks for the heads-up :)

benjo
05-24-2005, 04:42 PM
Ulysses great article. I think it's great that you stumbled upon this and figured it out.

But seriously is IE that messed up? WOW!

Ryan8720
05-24-2005, 07:38 PM
But seriously is IE that messed up? WOW!
Yes. And from what I've read, IE7 isn't going to be much better as far as standards go.

JPnyc
05-24-2005, 08:07 PM
Yes, it is supposed to be, but it'll be YEARS before sites can stop being coded with the previous versions of IE in mind.

Ryan8720
05-25-2005, 01:43 AM
What are the improvement?

I'll I've heard for sure is tabbed browsing. Nothing about CSS or PNGs.

Ulysses
05-25-2005, 09:27 AM
PNGs will surely be supported ... it'd be the only browser that wouldn't. As for CSS ... it doesn't look like conforming to a standard is on the top of Microsoft's priorities right now.

JPnyc
05-25-2005, 09:54 AM
PNG is supported in IE6, just not PNG transparency. As for the CSS, I was hoping MS would improve a few things, but at the same time I was hoping the w3c would improve a few things as well.

Ulysses
05-25-2005, 10:10 AM
Well, technically ... PNGs are supported, yes. But it has to be agreed, that they're as good as useless without alpha transparency support. Regarding the CSS and W3C ... I totally agree with you JPnyc ... it isn't looking good. Still, we're at least beyond the point of text-only design.