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

Re: display property

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 26 Jun 2003 07:00:21 -0700 (PDT)
To: Brian V Bonini <b-bonini@cox.net>
Cc: "www-style@w3.org" <www-style@w3.org>
Message-ID: <Pine.LNX.4.56.0306260657260.3625@dhalsim.dreamhost.com>

On Thu, 26 Jun 2003, Brian V Bonini wrote:
> As I understand it the display property with a value of block will apply
> block level formatting to the element it's defined for, e.g. img
> {display: block} that being the case why does the recommendation cite
> many such examples as:  p{display: block;} is this not redundant since p
> is already a block level element and furthermore confusing.

The terms "block level" in an HTML context and "block level" in a CSS
context are unrelated. It is quite possible, legal, and often useful, to
write things such as:

   p { display: table-cell; }
   span { display: block; }
   tr { display: inline; }

This does not in any way affect the meaning of the elements, nor their
allowed positions in the HTML markup, it merely changes what they look

By default, everything is 'display: inline'. Thus, the rule

   p { display: block; }

...is actually needed somewhere to get the usual effect that is expected.
User agents put this rule in the user agent stylesheet, so authors do not
have to put it in theirs.

Ian Hickson                                      )\._.,--....,'``.    fL
"meow"                                          /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 26 June 2003 10:00:20 UTC

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