Search
 
SCRIPT & CODE EXAMPLE
 

CSS

the difference between nth-child() and nth-of-type()

/*the difference between nth-child() and nth-of-type()    :
example : */
  li:nth-child(1) {
    color: red ;
  }
/* it selects the first CHILD of the "li"   */ 
  li:nth-of-type(1) {
    color: red ;
  }
/* it selects the first ELEMENT WITH A TYPE OF "li" in the "li" parent */
 /* watch this video :  "https://www.youtube.com/watch?v=dMxOojFq2ho" */
Comment

nth of type vs nth child

<section>
   <p>Little</p>
   <p>Piggy</p>    <!-- We want this one -->
</section>
Comment

nth of type vs nth child

p:nth-child(2) { color: red; }
Comment

PREVIOUS NEXT
Code Example
Css :: css for bigger screen size 
Css :: how to add a background color in css 
Css :: not checked css 
Css :: boostrap line 
Css :: hover show scrollbar css 
Css :: css align text 
Css :: how to add font otf format in html 
Css :: javascript canvas pixel art 
Css :: css margin top 
Css :: grid blocks center 
Css :: css image transition fade 
Css :: disabled button tailwind css class on basis of true false 
Css :: button css 
Css :: multiple divs next to each other 
Css :: outline radius css 
Css :: canvas disable antialiasing 
Css :: radial gradient css 
Css :: center an image 
Css :: fixed div with scrollable content 
Css :: Timeout for a fetch 
Css :: mediaquery for portrate 
Css :: input type file without button 
Css :: css img src 
Css :: can span have width 
Css :: css table properties 
Css :: last child after css 
Css :: css contour 
Css :: sticky footer not working bootstrap 
Css :: link active css 
Css :: ion-split-pane width 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =