David19801 David19801 - 1 month ago 6x
CSS Question

Change all link states same color css

I have a spanned class called "tomato".

My css is:

.tomato a:link {color:#FF0000;} /* unvisited link */
.tomato a:visited {color:#FF0000;} /* visited link */
.tomato a:hover {color:#FF0000;} /* mouse over link */
.tomato a:active {color:#FF0000;} /* selected link */

Is there a way I can combine all these into a smaller piece of code? (I want the link to be red in all states)


This is the shortest, I don't think you can do it any shorter than:

.tomato a:link, .tomato a:visited, .tomato a:hover, .tomato a:active { color:#FF0000; }


.tomato { a:link, a:visited, a:hover, a:active { color:#FF00000; } }

Hope this helps.