nth-child – POFTUT

CSS first-child Selector Tutorial with Examples

CSS first-child Selector Tutorial with Examples

We can select the first child of the given HTML element in different ways. But CSS provides the first-child attribute in order to select the first child of the given HTML element. We will also learn nth-child to select the first child. first-child Syntax The first-child CSS attribute syntax is like below. HTML_ELEMENT:first-child {  CSS_CODE; … Read more

CSS :nth-child Element Selector

CSS :nth-child Element Selector

CSS provides the :nth-child() selector which is ver useful select different elements with different rules and apply some CSS to these elements. :nth-child() is provided in the CSS version 3. Syntax CSS :nth-child() has the following syntax :nth-child(NUMBER){  CSS } `:nth-child` is the keyword `NUMBER` is the selected number or rule used to apply CSS. … Read more