CSS :first-child Selector

Last Updated Jul 21, 2015, 12:00:06 PM





CSS :first-child Selector

CSS :first-child selector is used to select the specified selector, only if it is the first child of its parent.

Syntax Example

The below example Select and style every <p> element that is the first child of its parent:


Try It Now

CSS Before Selector

CSS Selectors Reference

CSS Selectors Reference

Other CSS Selectors you might want to learn

CSS Basic Selectors

CSS Combinators



Sources and Credits

The source of the content has been referred and updated with Mozilla Foundation and W3C Organization

Last Updated Jul 21, 2015, 12:00:06 PM