HTML and CSS Reference
In-Depth Information
7
New CSS language features
This chapter covers
Selecting elements based on their parents
Selecting elements based on their siblings
Selecting elements dynamically according to user activity
Let's remind ourselves what a
CSS
rule looks like.
Rule
p { font-size: 1.4em; }
The part that tells the
browser what to do
Selector
Declaration
The part that tells the
browser what to do it to
In this chapter we're concerned entirely with the parts of
CSS
that appear
outside of the curly brackets—the selectors and associated syntax that
makes up a
CSS
document. After this chapter, we'll concentrate almost
completely on the stuff that appears inside the curly brackets—the prop-
erties and values that define the visual effect to be applied. The stuff that
appears inside the curly brackets is naturally more interesting, because
233