Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Styling a link based on its href

Tags:

jquery

css

anchor

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.

like image 602
Sourabh Avatar asked Apr 13 '26 02:04

Sourabh


1 Answers

You can use href CSS selector to style a tag based on link:

a[href="your url here"]{
        background:red;
}

Demo

like image 121
Vitorino fernandes Avatar answered Apr 15 '26 17:04

Vitorino fernandes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!