Re: simulating <br>

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 UTC