W3C home > Mailing lists > Public > www-style@w3.org > September 2002

Re: CSS2.1: \A and white-space

From: Bert Bos <bert@w3.org>
Date: Mon, 9 Sep 2002 14:10:04 +0200
Message-ID: <15740.36764.931008.883262@lanalana.inria.fr>
To: <www-style@w3.org>

Tantek Çelik writes:
> First there is the question of whether emulating this particular ancient
> browser quirk in CSS is even important anymore, since there are so many
> better mechanisms (e.g. margin, padding) to add white space _properly_,
> rather than with markup cheese like <br><br> or <spacer>.
> I'd say that in this day and age of CSS2.1 and CSS3, being able to style
> <br><br> to produce the same formatting result as that introduced years and
> years ago is a non-requirement.  Why would we want to encourage people to
> continue to use bad markup?

Good to find myself leapfrogged by the implementers :-) It's always
been my aim to be able to reproduce the layouts that were possible
with old Netscapes, but not necessarily in the same way. However, in
the past it has been hard to get that view past the working group...

I certainly agree that the proper way to get white space is to use
margin and padding, not <BR>.

In fact, when we designed CSS1, we thought that the proper way to
handle BR was as follows:

    BR {display: block}

or, if you want some space between the lines:

    BR {display: block; margin-top: 1.2em}

That was not how BR worked in Netscape, but rather than add something
strange like \A, we let BR be "magic" in CSS1. However, at the time of
CSS2, people still wanted BR to work like in Netscape, so we had to
come up with a solution. Maybe now, as XHTML 2.0 plans to deprecate
BR, the time is finally there to redefine BR as a structural element
and say that one BR or a hundred, there's no difference.

> Second, what about this?
>  br { display:inline; line-break-after:always }
>  br+br { display:block; height:1em }

Or even without any new properties:

    br { display: block }
    br + br { height: 1em }

(And if somebody wonders why this was not considered as a solution for
BR before, consider this mark-up:

    <P><BR>Some text</P>

in which the BR would have no effect.)

  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos/                              W3C/INRIA
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
Received on Monday, 9 September 2002 08:10:06 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:03 UTC