Re: <br> and generated-content

On Tue, Jul 1, 2008 at 10:47 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

>
> Daniel Glazman wrote:
>
>> It's off-topic but since we deal with <br> here, I urge
>> browser vendors to fully support ::before and ::after on <br>.
>> This allows very simple effects like
>>
>> body[showBRs="true"] br::before {
>>  content: "\0000b6"; /* ¶ */
>> }
>>
>
> So in a UA which implements <br> using generated ::before this would remove
> the line-break, and in a UA which implements <br> using generated ::after
> this would leave the line-break, right?
>
> And in a UA which treats <br> as a replaced element this may or may not do
> anything at all?
>
> I don't see anything wrong with requiring that <br> not be a replaced
> element, but that seems like an HTML decision, not a CSS one.
>
> -Boris
>
> Actually, it seems explicitly *not* an HTML decision.  HTML says that the
<br> element produces a line-break; it has *no* instructions on *how* to
produce this, nor should it.  Whether <br> is implemented with ::before,
::after, or as a replaced element (or in any other way) is completely the
domain of CSS.  This should be obvious merely from the fact that we're
wondering which *CSS selectors* apply to the element and how we can use
them.

Having <br>'s treatment under CSS be standardized across UAs is a worthwhile
goal as long as the element remains within html (and it likely always will,
as it does have semantic meaning).

~TJ

Received on Tuesday, 1 July 2008 16:18:09 UTC