问题
I have a 3rd party link on my website which I want to style. but it don't have any class or id which I can target. Only thing it have is its unique href value. Is it possible to style a anchor tag based on its href value.
回答1:
You can use href css selector to style a
tag based on link:
a[href="your url here"]{
background:red;
}
Demo
回答2:
You can use css attribute
selector like:
a[href="http://google.com"]{
your css code here ...
}
More information here.
Thanks.
来源:https://stackoverflow.com/questions/29331831/css-styling-a-link-based-on-its-href