element>element
In this chapter you will learn:
Description
The element>element
selector adds styles for
elements with a specific parent.
Example
<!DOCTYPE html><!--from ja v a2 s .c o m-->
<html>
<head>
<style>
div>span
{
background-color:yellow;
}
</style>
</head>
<body>
<div>
<h2>h2 inside div</h2>
<span>span inside a div.</span>
</div>
<div>
<p><span>span not directly inside a div.</span></p>
</div>
<span>span.</span>
</body>
</html>
Next chapter...
What you will learn in the next chapter:
Home » HTML CSS Tutorial » CSS Selector Reference