![](https://www.delftstack.com/img/CSS/feature image - css first of class.png)
CSS First Of Class Delft Stack
CSS - The :lang Pseudo-class. The :lang pseudo-class allows you to define special rules for different languages.. first-of-type: Selects every
element that is the first
element of its parent:focus: input:focus: Selects the element that has focus:hover: a:hover:
![](https://www.wikitechy.com/css/img/css/css-class-selector.png)
How To Call A Class In Css Várias Classes
The :first-of-type pseudo-class selects the first element of its type ( div, p, etc). Using a class selector (or a type selector) with that pseudo-class means to select an element if it has the given class (or is of the given type) and is the first of its type among its siblings. Unfortunately, CSS doesn't provide a :first-of-class selector.
![](https://i.ytimg.com/vi/mosao5vR0Bc/maxres2.jpg?sqp=-oaymwEoCIAKENAF8quKqQMcGADwAQH4Ac4FgAKACooCDAgAEAEYWyBbKFswDw==&rs=AOn4CLCTG0KPg1dxGrJFdzM_5wlTNBEh4Q)
css firstoftype YouTube
The :first-of-type CSS pseudo-class represents the first element of its type among a group of sibling elements. Try it Syntax :first-of-type Examples Styling the first paragraph HTML
Heading
Paragraph 1
Paragraph 2
CSS p:first-of-type { color: red; font-style: italic; } Result Nested elements![](https://i.ytimg.com/vi/kUw4eMeF5Cg/maxresdefault.jpg)
How to use Class in CSS Lesson 02 CSS YouTube
div:first-of-type → All
![](https://support.commercebuild.com/wp-content/uploads/2022/05/css-classes.png)
Useful CSS Classes for Content commercebuild Success Portal
The :first-of-type Selector is used to targeting the first child of every element of it's parent. if we want to style the first child of an element without giving a class, we can use it. Syntax: :first-of-type { //property } Example: HTML