Previous Message
Next Message

Firefox 1.0 rc2 not respecting clear:both; bug or correct behaviour?

Sent by Marcus A. Hofmann on 7 November 2004 11:11


Two days ago, I realized that Firefox 1.0 Release Candidate 2 on Mac OS 
X will not behave the same as previous versions in certain cases. It 
turned out that it will not respect the following rule:

..clear { clear: both; }
[... some floated divs...]
<div class="clear"> </div>

I have put up a very simple demo at:

As soon as that <div> gets some content, the clear is respected; using 
a <br> or <hr> with a class of "clear" works, too - just not an empty 
<div>. It worked in Firefox versions prior to 1.0rc2, though. Other 
browsers, such as Safari or Camino, respect the clear on the empty 

The Question now: Is this a bug introduced in Firefor 1.0rc2, or is it 
correct behaviour, and Firefox is more strict about the rules than 
other browsers? How is a <div> without content supposed to behave?

Three more things I would like to note:

1) I know that in this case, the "clear" could simply be applied to the 
footer style definition. Sometimes that is not possible, though. This 
is just a quick demo of the problem.

2) I find this disturbing, because I have seen the use of a <div> 
rather than a <br> or <hr> recommendet in several tutorials, the 
reasoning being that an empty div can be styled to be visible, but 
appear invisible, and can be used as a "helper-div" in many ways. I 
have never needed that (yet), but it made sense to me when I read it, 
so I have become used to using a clearing <div>, and I know of others 
who have, too.

3) I don't know if this is a platform specific problem since I couldn't 
test it in Firefox on Windows yet.

Cheers. Marcus

"The earth has music for those who listen." -- William Shakespeare

css-discuss [EMAIL-REMOVED]]
List wiki/FAQ --
Supported by --
Previous Message
Next Message

Message thread:

Possibly related: