Customize css link as url

3

I've seen somewhere that has a way to apply a particular css to a " a " if you have a particular text in the link, but I can not find it anymore.

For example, I have the following links in my html

<a href="http://site.com.br/nothing">Link para nada</a>
<a href="http://site.com.br/something"><Link para alguma coisa</a>
<a href="http://other.com.br/something"><Link para alguma coisa</a>

Assuming that only the link that has something in href has a different style, how could you do that?

    
asked by anonymous 18.11.2015 / 13:05

2 answers

3

use for example

a[href="http://site.com.br/something"]{
    font-size: 30px;
}

To consider only one part of the url, just use a * soon after href

a[href*="something"]{
    font-size: 30px;
}
    
18.11.2015 / 13:07
3

Using this selector.

a[href="http://site.com.br/nothing"] {
  color: red;
}

Reference .

    
18.11.2015 / 13:07