nth-of-type vs. nth-child - CSS Selectors

preview_player
Показать описание
CSS selectors: understand the difference between nth-of-type and nth-child. Working with HTML5 and CSS3. Created by Gregg Fine.

📖 Download my FREE "Google Search Secrets for Developers" Cheat Sheet:

🗣JOIN the Code Creative Facebook group! :

🌐 The Code Creative Official Website

🎓 The Code Creative Courses

✅ Let's connect:

Twitter - @GreggFine

Instagram - /greggfineguitar
Рекомендации по теме
Комментарии
Автор

🗣JOIN the Code Creative Facebook group! :

TheCodeCreative
Автор

Extremely clear and simple to understand in only 3 minutes. Thank you very much for this explanation, now I can stop screaming at my computer

WhatTheCinnamonToastFck
Автор

📖 Download my FREE "Google Search Secrets for Developers" Cheat Sheet:

TheCodeCreative
Автор

Went through a few videos to try to understand this concept, and yours was the clearest for me! Thanks for the content.

lesliewilliams
Автор

Finally someone made it clear like that!

haiderwaseem
Автор

Thanks very much...everything is clear now.

shirmilwelgama
Автор

very nice and easy to follow.
Just a little question: if you write div:nth-child(){ color: red} does it treat any tag as child but changes the color only for those that are divs, or doest it initially treat only the divs as children?

adennis
Автор

This is amazing, I ran through this "problem" when I was using first-child, but the element I wanted was the second child, not the first, I needed to change it to nth-of-type(1) to work

DanielRios
Автор

hello. I got your explanation so far. thank u for that
but at the same time I can´t understand this example:
html:
<ul>
<li>Cuestionario <span>Espai</span></li>
<li>Nosotros
<ul>
<li>Alumnos</li>
<li>Profesores</li>
<li>Escuela</li>
<li>Asesoramiento</li>
</ul>
</li>
<li>Escuela virtual</li>
<li>Blog</li>
<li>Redes sociales</lI>
<li>Condiciones</li>
<li>Contacto</li>
</ul>


CSS: li:nth-child(3){color:red;}

the answer is Escuela and Escuela virtual, I understand escuela virtual but I can´t comprehend why *escuela* will have color red.
thanks

GenesisLopez-hqig
Автор

To the point and what I needed. Thanks!

asfandiyar
Автор

I have read 2 or 3 article still I was confused
But made me understand this concept in 3 min

calisthenics-
Автор

Great video thanks for the explanation!

DjCppsNews
Автор

is it possible to select a class by nth-of-type / nth-child? eg:- .box:nth-of-type(even)

Spiderzzzzzzzzzzzz
Автор

It was very good, I understood it very clearly

ramineghbaliankhob
Автор

Is this only applicable to list-items? What about element in a div? like bunch of images in a div or paragraphs in a div

saltech
Автор

ok, but in the second ul how can you color only the last li?

ionuthorgos
Автор

good video thank you for the explanation)

АлександрИлюхин-зч
Автор

cheers mate. Well explained video. Keep it up x

alext
Автор

what is the name of this vs code theme🤔?

muhammadgad