• Post Reply Bookmark Topic Watch Topic
  • New Topic

Changing color of item in list  RSS feed

 
Cody Biggs
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So now I am trying to change the color of the 4th item in my list, but I cant get it to show. I got my first and last item to change color so I dont know why this isnt working....

my CSS:


 
Cody Biggs
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry it would be nth-child(4 )to get to the 4th item?
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37384
531
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Code,
Your CSS is correct. I think the problem is that it doesn't match your HTML.

If I run that CSS with this XML, it displays the colors.


I suspect your HTML has
    though. In which case, you'd need, the CSS to look like this:

 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!