Title: Class Selectors example
Course: Intermediate Web Programming (25436)

This is a heading with the same class as the second paragraph

This tag has no class.

When a tag is identified with a class, we can target it regardless of its position in the hierarchy.

In this div, the span tag may or may not be styled.


<!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" lang="en" xml:lang="en">
<head>
<title>Class Selectors example</title>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Language" content="en-us" />
<style type="text/css">
p {font-family: Helvetica, sans-serif;}
.specialtext {font-weight:bold;}
p.specialtext {color:red;}
p.specialtext span, h1.specialtext span {font-style:italic}
 </style>
</head>
<body>
<h1 class="specialtext">This is a heading with the <span>same class</span> as the second paragraph</h1>
<p>This tag has no class.</p>
<p class="specialtext">When a tag is identified with a class, we can target it <span>regardless</span> of its position in the hierarchy.</p>
<div class="specialtext">In this div, the span tag <span>may or may not</span> be styled.</div>

</body>
</html>