CSS code to change the color of hyperlinks on tbody table body
To change the color of hyperlinks in a table body (tbody) element in CSS, you can use the following pseudo-classes to target different states of the hyperlink.
- :link,
- :hover,
- and :active
- :visited
For example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
tbody a:link { color: blue; } tbody a:hover {
color: green; } tbody a:active { color: yellow; } tbody a:visited { color: pink; } |
- Normally the hyperlink color will be blue
- Pink when hyperlink has been visited,
- Green when the user hovers over on hyperlink,
- Yellow when the user is actively clicking on hyperlink.
You can also use the color property to change the color of all hyperlinks within a table body at once, like so:
1 2 3 4 5 |
tbody a { color: green; } |
This will change the color of all hyperlinks within the table body to green, regardless of their state.