Re: display property

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
like.

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.

HTH,
-- 
Ian Hickson                                      )\._.,--....,'``.    fL
"meow"                                          /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'

Received on Thursday, 26 June 2003 10:00:20 UTC