Background colors

Eric A. Meyer writes:

 >    Say I have the following markup, assuming no other styles in the document:
 > 
 >      <BODY style="background-color: silver;">
 >      <P style="background-color: red;">
 >      This paragraph has a
 >      <SPAN style="background-color: transparent;">red</SPAN> background.
 >      </P>
 >      </BODY>
 > 
 >    What is the background color of the word "red?"

Assuming SPAN is an inline element and P is block-level, SPAN will be
inside the block formed by P. Since SPAN's background is transparent,
P's will shine through. Thus, the background color should be red.

-h&kon (who hasn't tested it in any browser)

Received on Wednesday, 28 January 1998 18:17:50 UTC