RE: block level formatting

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 UTC