Customize css link as url

Posted on

Question :

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="">Link para nada</a>
<a href=""><Link para alguma coisa</a>
<a href=""><Link para alguma coisa</a>

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


Answer :

use for example

    font-size: 30px;

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

    font-size: 30px;


Using this selector.

a[href=""] {
  color: red;

Reference .


Leave a Reply

Your email address will not be published. Required fields are marked *