I want to give the same style to 2 particular links and my current code is the following:
a#id1:link {color:darkgray;}
a#id1:hover {color:white;}
a#id1:active {color:red;}
a#id1:visited {color:black;}
a#id2:link {color:darkgray;}
a#id2:hover {color:white;}
a#id2:active {color:red;}
a#id2:visited {color:black;}
How can I summarize it? I tried something like a#id1#id2:link {color:darkgray;} but it doesn't work.
Greetings, Leandro.
You just group them with a comma separator indicating that the same rule is applied to both selectors like so:
Adding @alanfcm's solution:
As alanfcm said in the comment you can also add a common class for both like this:
You can also create a class for both links:
and the css would be: