W3C home > Mailing lists > Public > www-style@w3.org > June 2008

Re: The <br> tag and the line-height CSS attribute.

From: David Woolley <forums@david-woolley.me.uk>
Date: Fri, 27 Jun 2008 09:10:31 +0100
Message-ID: <4864A077.8030302@david-woolley.me.uk>
To: CSS 3 W3C Group <www-style@w3.org>

Francois Remy wrote:

> I'm recontacting you because I've detected, a long time ago, a thing 
> that seems to be not clear in the CSS Specs.
>  
> When you have a <BR> that's alone on a line and when you apply a 
> line-height attribute to it, should the line that he occupes change of 
> height ?

Conceptually, the typical browser style sheet implements BR *elements* 
by generating a newline character as generated content.  The answer, 
therefore, depends on whether that character is conceptually on the 
first or second line.  Conventionally newline is associated with the old 
line, so I think the lineheight probably should affect the old line.

Note that it is the generated newline that produces the BR effect, so, 
for a browser that actually uses CSS for BR, this applies to any use of 
generated newlines in inline elements, and it only applies to BR to the 
extent that its generated content is not overridden.

Incidentally, the HTML specification doesn't require <br><br> to take 
any space at all, and I believe, that, historically, that (i.e. the 
TeX/troff interpretation) was the original behaviour.  Only with the 
advent of GUI browser did its meaning drift to the WYSWYG hard newline 
concept.  The specification is still ambiguous, so both are probably 
valid.  A such, it is safer to a PRE element (with the default 
whitespace:pre style) to force newlines.

PS your mail has a suspicious, and irrelevant, application/octet stream 
(binary with no explicit type) attachment.  File content sniffing 
indicates that it is actually JPEG, but browsers should not make that 
inference, even though IE does.



-- 
David Woolley
Emails are not formal business letters, whatever businesses may want.
RFC1855 says there should be an address here, but, in a world of spam,
that is no longer good advice, as archive address hiding may not work.
Received on Friday, 27 June 2008 08:09:04 GMT

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