CSS – :first-child Selector
The :first-child selector selects all HTML elements of a specified type that are also the first child of their parent element.
The :first-child selector selects all HTML elements of a specified type that are also the first child of their parent element.
The ::first-letter selector is used to select the first letter of a specified, block-level element such as a paragraph or heading.
The :empty selector selects empty HTML elements, which means an element without any child elements or text.
The ::first-line selector is used to select the first line of text of a specified, block-level element such as a paragraph or heading.
The :first-of-type selector selects all elements that are the first child of a specified type of their parent element.
The :focus selector selects the element that currently has focus.
The :fullscreen selector is used to select any elements that are in full-screen mode.
The :hover selector selects elements when you mouse over them, and is commonly used for links and images with links, but can be used on any element.
The #id selector selects an HTML element with a specific id. HTML only allows for one unique #id per document.
The :in-range selector selects elements with a value that is within a specified range, and only works for input elements with min/max attributes.
The :indeterminate selector selects form elements that are in an indeterminate state.
The :invalid selector selects form elements with a value that does not validate according to the element’s settings.
The :lang selector is used to select elements with a lang attribute with a specified value (e.g., lang = “en” or lang = “en-us”).
The :last-child selector selects all HTML elements of a specified type that are also the last child of their parent element.
The :last-of-type selector selects all elements that are the last child of a specified type of their parent element.
The :link selector is used to select unvisited links, and will not style links you have already visited.
The ::marker selector selects the marker of a list item (the bullet or number).
The :not() selector selects all elements except the specified element.
The :nth-child() selector selects all specified elements that are the nth child of their parent, regardless of all the children’s types.
The :nth-last-child() selector selects all specified elements that are the nth child of their parent counting from the last child.
Thanks for your support!
All are affiliate links. Thank you for your support!