Wednesday, February 28, 2007

Descendant Selectors

A way of specifying a selector like "select an >h2< element, but only if it's inside an elixirs >div<.

XHTML:
<div id="elixirs">
<h2>Weekly Elixir Specials</h2>

<p>
<img src="images/yellow.gif" alt="Lemon Breeze Elixir">
</p>

<h3>Lemon Breeze</h3>

<p>
The ultimate healthy drink, this elixir combines herbal botanicals, minerals, and vitamins with a twist of lemon into a smooth citrus wonder that will keep your immune system going all day and all night.
</p>

</div>


CSS:
#elixirs h2 {color: black;}

#elixirs h3 {color: red; }

No comments: