W3C home > Mailing lists > Public > www-style@w3.org > October 2000

Re: simulating <br>

From: Todd Fahrner <fahrner@pobox.com>
Date: Tue, 24 Oct 2000 15:33:18 -0700
Message-Id: <v04220806b61bab72e503@[209.21.38.75]>
To: "L. David Baron" <dbaron@fas.harvard.edu>
Cc: www-style@w3.org
At 5:00 PM -0400 10/24/00, L. David Baron wrote:

>Authors expect multiple BR elements to create multiple line breaks, but
>a single BR element should create 1 line break without a blank line.

Yes, but different UAs handle BR differently when it is adjacent to 
elements/tags that typically interrupt text flows themselves (leave 
aside the CSS worldview for a moment). Expected behavior is 
undefined. For a long time, the most effective way to "space down" 
consistently in mainstream UAs such as Netscape and IE 2-4 was to 
intersperse non-breaking spaces with BRs, or at least at the ends of 
BR runs, to assure that they'd be rendered in the wished-for manner. 
E.g., this produces different results in Nav and IE:

<td>Foo
<br>
<br>
</td>

...while this "worked":

<td>Foo
<br>
<br>&nbsp;
</td>

I now avoid (and recommend avoiding) all such usages, e.g.:

<td><br>Foo</td>

<td>Foo<br></td>

<br><hr><br>

<p><br>Foo</p>

<p>Foo<br></p>

<br><p>Foo</p>

<p>Foo</p><br>

<div><br>Foo</div>

<div>Foo</div><br>

etc.

In fact, the only time I use BR these days is within flows in blocks, 
such as between lines in an ADDRESS element. I find that I can use 
well-formed structural markup with CSS box properties in virtually 
all the cases where I would previously (ab)use BR. The result is 
often not quite right in Netscape 4, but I can usually cite falling 
market share credibly enough that my taskmasters let it slide.
--
Todd Fahrner
Received on Tuesday, 24 October 2000 18:33:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:06 GMT