Here is the markup which I'm going to use in this article:
FIRST-CHILD SELECTOR :- It allows us to target an element that is the first child element within its parent.
these styles will be applied to RowAB and RowA, because they are first child of p parent tag.<div class="outercontent">
<div class="content">
<p>RowAB</p>
<p>RowBC</p>
<p>RowCD</p>
<p>RowDE</p>
<a href="#">text in between</a>
<p>RowEF</p>
</div>
<div class="content">
<p>RowA</p>
<p>RowB</p>
<p>RowC</p>
<p>RowD</p>
<p>RowE</p>
<a href="#">link at the end</a>
</div>
</div>
FIRST-CHILD SELECTOR :- It allows us to target an element that is the first child element within its parent.
LAST-CHILD SELECTOR :- It works absolutely identical as first-child, except that it selects the last element within its parent.
NTH-CHILD SELECTOR :- It allows us to target an element that is the nth child element within its parent
That’s it!!…..Happy Programming...
No comments:
Post a Comment