Welcome to WebHeadStart.org

Web Technologies

Sponsored By

WebHeadStart.org is currently in beta.
Please pardon our appearance as we work to provide you with the most comprehensive reference on today's web technologies.

Interested in advertising on WebHeadStart? Become an advertising partner today!

[WWW-HTML Mailing List Archive Home] [Messages By Thread] [Messages By Date]

RE: block level formatting

From: Asbjørn Ulsberg <asbjorn.ulsberg@nrk.no>
Date: Thu, 26 Jun 2003 10:18:06 +0200
Message-ID: <D186E3C450FED2119AFA00508B08736F06E938E8@MAEXCH05>
To: "'Brian V Bonini'" <b-bonini@cox.net>
Cc: www-html@w3.org

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.

-- 
Asbjørn Ulsberg           -=|=-          X-No-Archive: No
"He's a loathsome offensive brute, yet I can't look away"
Received on Thursday, 26 June 2003 04:18:17 GMT
Valid XHTML 1.0! Valid CSS! Site Map | Privacy Policy | Terms of Use | WebHeadStart.org © 2005 All Rights Reserved.