CSS Pseudo-class :first-child Selector
What is a CSS Pseudo-class :first-child Selector?
- The :first-child pseudo-class selector specifies an element that is the first child of another element. In the following example, the color property will be set to red for any <p> element that is the first child of the <div> element. The style is NOT applied to the second <p> element since it is the second child.