- From: Alan Gresley <alan@css-class.com>
- Date: Sun, 03 Jul 2011 22:35:15 +1000
- To: Anton Prowse <prowse@moonhenge.net>
- CC: www-style list <www-style@w3.org>, robert@ocallahan.org, Boris Zbarsky <bzbarsky@mit.edu>
On 3/07/2011 9:41 PM, Alan Gresley wrote: > I have noticed that this does not just apply to opacity but to normal > background-color. Consider this test case. Why does the anonymous block > (with inlines) of the paragraph, not have a background-color? > > <!doctype html> > <style type="text/css"> > p {background: green; border: 10px solid blue; } > div {background: red; } > </style> > <p><div>Block</div> This paragraph should have a green background.</p> Just got a offlist response. I forgot about soup parsing. This does make it hard to work on CSS when CSS must suit two modes of behavior. For html5: <p></p><div>Block</div> This paragraph should have no background color.<p></p> For xml/xhtml: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en"> <head> <title>Title</title> <style type="text/css"> p {background: green; border: 10px solid blue; } div {background: red; } </style> </head> <body> <p id="test"><div>Block</div> This paragraph should have a green background.</p> </body> </html> -- Alan Gresley http://css-3d.org/ http://css-class.com/
Received on Sunday, 3 July 2011 12:35:47 UTC