Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Ariel Vainer7,042 Points
What is the correct sintax if I want to use the nth-child in two different lists?
If I have 2 ul, how can I target them separately? I want them to have different values. How can I make the difference between both of them?
Simply use a "class" for your two ul. Maybe use .listOne and .listTwo then you can target them separately.
Hope this helps.
Chris Shaw26,650 Points
If you want both lists to see the same CSS when using
nth-child then a class is the best way to go about, just be sure the class comes after your initial CSS for your lists otherwise the styles won't overwrite anything your doing within
Hope that helps.