Contextual Selectors

selector1 selector2 { ...rules... }

Example 3.35 - contextual selectors - Example 3.35 (Without Styles)
 <div><em>Emphasized text</em>outside of<strong>li</strong>appear "normal".<ul>
<li><em>Emphasized text</em>within<strong>li</strong>have a different style.</li>
</ul></div>

In style element (<style type="text/css">) within head element:


li em { color: red; background-color: navy;}
 

Screenshot

Copyright © David Heitmeyer