For example:
What does div > p.some_class { ... }
selects ?
For example:
What does div > p.some_class { ... }
selects ?
All p tags with class 'some_class' which are children of a div tag.
It matches p
elements with class some_class
that are directly under a div
.
>
is the child selector, or a direct descendant selector.
That means it only selects paragraphs of some_class
that sit directly inside a div
.
An illustration:
<div>
<p class="some_class">Some text here</p> <!-- Selected [1] -->
<blockquote>
<p class="some_class">More text here</p> <!-- Not selected [2] -->
</blockquote>
</div>
Footnotes:
<div>
.<blockquote>
.