<!-- CSS:Basics plus snippet 1. -->
<!-- Mutiple and descendant selectors. -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- Code source: http://www.justfigures.co.uk/ -->
<!-- A resource for web developers using XHTML, CSS, JavaScript, PHP -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>View snippet page</title>
<style type="text/css">
/* using multiple selectors to define styles for multiple XHTML elements */
/* note the comma separators */
h1,h2,h3,p,ul {
font-family: Arial, Helvetica, sans-serif;
font-size: 18px;
font-weight: normal;
color: #000000;
}
/* using descendant selectors to define a style for an
emphasis that is descendant of an unordered list */
/* note the whitespace separator */
ul em {
color: #0000FF;
}
</style>
</head>
<body>
<h1>Level 1 Heading.</h1>
<h2>Level 2 Heading.</h2>
<h3>Level 3 Heading.</h3>
<p>Paragraph text with an <em>emphasis</em> that is not a descendant of a list so will not appear blue.</p>
<p>An unordered list with an emphasis on 'Item 2' that is a descendant of a list.</p>
<ul>
<li>Item 1</li>
<li><em>Item 2</em></li>
<li>Item 3</li>
</ul>
</body>
</html>