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

Re: display property

From: Jens Meiert <jens.meiert@erde3.com>
Date: Thu, 26 Jun 2003 19:45:27 +0200 (MEST)
To: www-style@w3.org
Message-ID: <23396.1056649527@www12.gmx.net>

> By default, everything is 'display: inline'.

That's not true. Simply test a page including

      <p>A paragraph.</p>
      <p>A second paragraph.</p>
      <p>Yes, a third.</p>

and look at it. Now add

      p { display: inline; }

to your CSS and see the result. There is no 'display: inline' default, in no
browser.

I see Brian's point, and I would change the example, but not the
implementation. It is the same thing like some people writing

     b { font-weight: bold; }

to their code.


Regards,
 Jens.



> 
> 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/                         `._.-(,_..'--(,_..'`-.;.'
> 


-- 
Jens Meiert

Steubenstr. 28
D-26123 Oldenburg

Mobil +49 (0)175 78 4146 5
Telefon +49 (0)441 99 86 147
Telefax +49 (0)89 1488 2325 91

Mail <jens@meiert.com>
Internet <http://meiert.com>
Received on Thursday, 26 June 2003 13:45:34 GMT

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