
Apu
November 23, 2022 .
#css
.
#Css Tutorial
❌
What is first child in CSS?
The first-child is a pseudo class in CSS that represents the first element in a group of sibling elements.
Using the first-child pseudo class, we can select the first child of a parent element.
CSS Syntax #
:first-child { // css here }
Suppose you have one ol element and four li elements. Now you want to style the very first li element. You can easily select the first li element using the first-child pseudo class.
Example : Style the first <li> element in lists. #
<style>
li:first-child {
background-color:blue ;
color:red;
padding:5px ;
}
</style>
<ol>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ol>
Pdf
Save
Listen
What is first child in CSS?
0
The first-child is a pseudo class in CSS that represents the first element in a group of sibling elements. Using the first-child pseudo class, we can …
asked
Apu
0 answers
2915
The first-child is a pseudo class in CSS that represents the first element in a group of …
Answer Link
answered
Apu