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

RE: block level formatting

From: Brian V Bonini <b-bonini@cox.net>
Date: 26 Jun 2003 14:13:06 -0400
To: www-html@w3.org
Message-Id: <1056651186.23562.66.camel@gfxdesign>

On Thu, 2003-06-26 at 04:18, Asbjørn Ulsberg wrote:
> Brian V Bonini wrote:
> 
> > #lines { display: block; }
> > 
> > <div id="lines"><img src="xxx" /><img src="xxx" />
> > <img src="xxx" /></div>
> 
> <div> is a block element by default, so your CSS does nothing
> with the above HTML code. If you want the images inside the
> <div> to be block elements, you should write:
> 
>   /* display all descendant images of #lines as block
>   elements */
>   #lines img {
>     display: block;
>   }
> 
> or 
> 
>   /* display all images that are directly children of #lines
>   as block elements */
>   #lines>img {
>     display: block;
>   }
> 
> > in this scenario is display: block saying to display div
> > id=lines as a block level element
> 
> Yes.
> 
> > or to display the contents of div id=lines in this case img
> > as block level elements.
> 
> No. You have the "id" attribute on the <div>, and then the id
> selector (#lines) style this one directly. 
> 
> > but is this the correct usage?
> 
> If you want to display the images inline, and the <div> as a
> block, you don't have to do anything in CSS at all, because
> this is their default appearance.

That being the case why does the CSS 2 recommendation cite examples of
the display property such as p {display: block}, is this not as
redundant as div {display: block} and at the very least confusing?
Received on Thursday, 26 June 2003 14:08:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:55 GMT