html - Can I add a class to a link -
all want add class link, change color of linked text. possible? isn't working me:
<a href="mailto:xyz.co.uk" class="black_link">xyz.co.uk</a> .black_link a:link { color:black;} .black_link a:visited { color:black;} .black_link a:hover { color:pink;} .black_link a:active { color:pink; }
thanks
if targeting <a> tag
globally use
a:link { color:blue;} a:visited { color:black;} a:hover { color:pink;} a:active { color:pink;}
if using class in <a> tag
can in 2 ways.
1st a.black_link:link { color:blue;} a.black_link:visited { color:black;} 2nd .black_link:link{color:blue;} .black_link:visited{color:pink;}
Comments
Post a Comment