W3C home > Mailing lists > Public > www-style@w3.org > August 2005

RE: CSS 2.1 Block inside inline behaviour

From: Ian Hickson <ian@hixie.ch>
Date: Fri, 26 Aug 2005 18:17:02 +0000 (UTC)
To: Michael Gannon <michael.gannon@blastradius.com>
Cc: David Woolley <david@djwhome.demon.co.uk>, www-style@w3.org
Message-ID: <Pine.LNX.4.62.0508261802430.30060@dhalsim.dreamhost.com>

On Fri, 26 Aug 2005, Michael Gannon wrote:
> 
> So if I change the HTML to be valid: 
> 
> <body>
>   <div style="border: 1px solid blue; ">
>       <span style="background-color: yellow; color: red">
>             Inline text
>             <span style="display: block">Block level element</span>
>             More inline text
>        </span>
>   </div>
> </body>
> 
> Yeah, my real question was CSS related - should the text "Block level
> element" have a background colour of yellow?

No, because the inline "stops" before the block-level element, and 
"resumes" after it.


> From looking at the spec again, it seems that background colour isn't 
> inherited by default, but it does have an initial value of transparent. 
> Therefore, the text "Block level element" should have a background of 
> yellow, no?

No, because the inline only appears on line boxes, and the block-level box 
is between the line boxes.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Friday, 26 August 2005 18:17:22 GMT

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