Reputation: 396
Is there a better way to target these selectors instead of having to repeat them like below?
h1 a:hover {
color: black;
text-decoration: none;
}
h1 a:active {
color: black;
text-decoration: none;
}
h1 a:link {
color: black;
text-decoration: none;
}
h1 a:visited {
color: black;
text-decoration: none;
}
Upvotes: 0
Views: 54
Reputation: 586
Yes, We can use commas for a separate style CSS and reduce CSS lines.
h1 a:hover,
h1 a:active,
h1 a:link,
h1 a:visited {
color: black;
text-decoration: none;
}
Upvotes: 0
Reputation: 207983
Yes, simply separate them with commas:
h1 a:hover, h1 a:active, h1 a:link, h1 a:visited {
color: black;
text-decoration: none;
}
You might want to brush up on the basics of CSS
Upvotes: 2