On 8/2/07, Thomas Dalton <thomas.dalton(a)gmail.com> wrote:
It's not CSS support, it's HTML support - div
is part of HTML. I just
loaded a text file containing the following in Firefox:
It printed foo and bar on separate lines.
Er, yes, the div will break a line, because it's a block element. It
will not, however, add any additional vertical whitespace, which <br>
will. Try the following:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
If the previous and next boxes are inline-level, there will be no
difference, because each type of markup effectively adds a line break
that wasn't present before. (Actually there will probably be subtle
differences, because the div will create new block wrappers around the
inline elements, while <br> will not, but there won't be very obvious
differences.) If either the previous or next box is block-level,
however, as in the case being discussed, <br> will add a new line, but
<div></div> will not affect layout without extra style rules, making
it more suitable for clearing.