Style sheet for example demonstrating adjacent sibling and child selectors
<?xml version="1.0" ?>
<!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" lang="en" xml:lang="en">
<head>
<title>Using fewer classes</title>
<style type='text/css'>
body {
color:#000000;
background-color:#ffffff;
font-size:12px;}
p {font-family:arial, verdana, sans-serif;}
div>p {border:1px solid #000000;}
p+p+p {background-color:#d6d6d6;}
</style>
</head>
<body>
<p>Paragraph One: not inside a div element.</p>
<div>
<p>Paragraph Two: inside a div element</p>
<p>Paragraph Three: inside a div element</p>
<p>Paragraph Four: inside a div element</p>
<p>Paragraph Five: inside a div element</p>
<p>Paragraph Six: inside a div element</p>
</div>
</body>
</html>
Related examples in the same category