Forum Moderators: not2easy

Message Too Old, No Replies

Alternative to display:none

Trying to avoid another IE bug

         

MatthewHSE

12:37 am on Jul 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm working on a new layout that will be using quite a few floats. In order to work for many pages on my site, I'll be using body id's and using display:none to hide certain elements within certain body id's. But, according to this article...

[positioniseverything.net...]

...using floats and display:none can cause really odd IE bugs that could potentially destroy a page layout. So I was wondering, is there any alternative to display:none, perhaps using some sort of width/overflow combination, that works reliably, cross-browser, to hide page elements even if they have content in them?

Of particular interest in the article:

Update! July 5, 2004 — It turns out that this duplicating characters bug can be triggered by other things than just HTML comments. Phil Baines points out that any elements given the style {display: none} will also induce the bug. Other than that, the same conditions apply. Since HTML comments remove content from a page just like {display: none}, does this mean that IE is using the same buggy mechanism for both?

This should be a good one for all of us to puzzle and stew over for awhile; so far I haven't come up with a solution that works. Should be an interesting study though!

Thanks,

Matthew

SethCall

3:06 am on Jul 21, 2004 (gmt 0)

10+ Year Member



wow... that really sucks.

Only thing that comes to mind is setting height and width to 0?

DrDoc

4:51 am on Jul 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Don't worry about it... If there's ever duplicated characters and such, just add
display:inline;
to the floated element. In fact, always add
display:inline;
to all floated elements to avoid other funky bugs in IE.