Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. :link — the normal, default state of links, just as you first found them.
  2. :visited — selects links that you have already visited in the browser you are currently using.
  3. :focus — selects links that currently have the keyboard cursor within them.
  4. :hover — selects links that are currently being hovered over by the mouse pointer.
  5. :active — selects links that are currently being clicked on.
  6.  
  7. To select just the odd or even list items, we'd use these:
  8. li:nth-child(odd)
  9. li:nth-child(even)
  10.  
  11. Or we could use
  12. li:nth-child(2n+1)
  13. li:nth-child(2n+0)
  14.  
  15. To do the same thing.
  16. Let's look at some other formula examples:
  17. li:nth-child(5): select the 5th adjacent list item
  18. li:nth-child(4n+1): select every 4th list item starting at 0, and then add 1 to each result. So numbers 1, 5 and 9.
  19. li:nth-child(3n-2): select every 3rd list item, and subtract 2 from each result. So numbers 1, 4 and 7.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement