Hello!
In this example is said that
. Instead of adding the class, we could use the
:first-child
pseudo-class selector — this will always target the first child element in the article, and we will no longer need to edit the HTML
As I see from this situation:
- When we need to paste an additional text (in the case with the".first" class) and we want it to be bold, we have to either add a text inside the first
<p>
or to add another one<p class="first">
below. - When we need to paste additional text (in p:first-child case) and we want it to be bold - we have to add a text inside the first
<p>
.
So I would like to catch where is this benefit?