O'Reilly logo

HTML5 and CSS3: Visual QuickStart Guide, Seventh Edition by Bruce Hyslop, Elizabeth Castro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Selecting Elements by Context

In CSS, you can pinpoint elements depending on their ancestors, their parent, or their siblings (see “Parents and Children” in Chapter 1) (Image through Image).

An ancestor is any element that contains the desired element (the descendant), regardless of the number of generations that separate them.

Image I’ve shortened the text to make the relationships between elements easier to see. Each indentation represents a generation. Note that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required