Using the Document Hierarchy
Learn how to select specific elements in CSS in accordance with the document hierarchy.
We'll cover the following
Using the document hierarchy
We can combine multiple items to create more specific selections by following the principles of the document hierarchy.
It’s common to have a span
tag nested inside a p tag. We can target the nested span
tag without applying the style to any unnested span
tags in the following way:
Get hands-on with 1400+ tech skills courses.