CSS
-Tricks
treehouse :
what would you like to learn today?
Web Design
Web Development
iOS Development
Show search box
Search
Search in:
All
Articles
Forums
Snippets
Videos
✕
Home
Forums
Snippets
Gallery
Videos
Almanac
Demos
Lodge
Navigation 'n' Search
Forums
Illustration by Nick Sirotich
Forums
»
CSS Combat
help with nth child
cybershot
Permalink to comment
#
May 2011
I added a span with a class to add an image after the navigation link. It works fine but now I need to remove the first one and leave the rest. I thought nth-child ? Does this work for the first one though?
jamy_za
Permalink to comment
#
May 2011
Wouldn't :first-child be more efficient?
cybershot
Permalink to comment
#
May 2011
i am targetting the first element. Not a child. would that work?
chrisburton
Permalink to comment
#
May 2011
Can you show the code? Are you referring to something like:
span.blah:nth-child(1) {display: none;}
jamy_za
Permalink to comment
#
May 2011
element:first-of-type { style properties }
https://developer.mozilla.org/en/CSS/:first-of-type
Add a Comment
https://developer.mozilla.org/en/CSS/:first-of-type