:last-child
In this chapter you will learn:
Description
The :last-child
selector selects the last child element.
Example
<!DOCTYPE HTML> <!-- j av a2 s .co m-->
<html>
<head>
<style type="text/css">
:last-child {
border: thin black solid;
padding: 4px;
}
</style>
</head>
<body>
<p>I like <span>HTML</span> and <span>CSS</span>.</p>
<a href="http://java2s.com">Visit java2s.com</a>
</body>
</html>
The body element is the last child of the html element and is matched by the selector.
Next chapter...
What you will learn in the next chapter:
Home » HTML CSS Tutorial » CSS Selector Reference