Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :link — the normal, default state of links, just as you first found them.
- :visited — selects links that you have already visited in the browser you are currently using.
- :focus — selects links that currently have the keyboard cursor within them.
- :hover — selects links that are currently being hovered over by the mouse pointer.
- :active — selects links that are currently being clicked on.
- To select just the odd or even list items, we'd use these:
- li:nth-child(odd)
- li:nth-child(even)
- Or we could use
- li:nth-child(2n+1)
- li:nth-child(2n+0)
- To do the same thing.
- Let's look at some other formula examples:
- li:nth-child(5): select the 5th adjacent list item
- 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.
- 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