How to change a link color? [duplicate]

1

Good afternoon,

I want to change the color of my <a href=""></a> but I can not do it

CSS Code:

a:hover{

  color: #fff;
}

but it changes the color when passing the arrow of the mouse over the link but I can not make it change color without passing the mouse

    
asked by Critical Ghost 13.06.2017 в 22:33
source

3 answers

2

You could do something like this:

a{
  color: black;
}

a:hover{
  color: red;
}

a:active{
  color: blue;
}
<a href="index.html">Clic</a>

We use the sentence:

a{
  color: black;
}

To indicate the color Black , to the elements of type <a> .

We use the sentence:

a:hover{
  color: red;
}

To indicate the color Red , to the elements of type <a> , when the mouse is passed over them.

Update

We use the sentence:

a:active{
  color: blue;
}

To indicate the color Blue , to the elements of type <a> , when you press with the mouse on them. That is, when you click.

Update 2

If you want to do everything in a single line (although it is not recommended because you could not centralize the design in another file) .

You could do something like this:

<a href='index.html' style='color: black'>Clic</a>

Although this would only work for the color in general , but not for the events hover or active .

    
answered by 13.06.2017 / 22:36
source
1

You only have to remove the :hover which is the one that indicates that it is a style that must be applied when passing over the mouse

body{
  background-color: #000;
}

a{
   color: #fff;
}
<a href="">Link color</a>
    
answered by 13.06.2017 в 22:38
0

Change the color without mause hover:

a {
    color: red;
}
<p><b><a href="enlace.jsp" target="_blank">texto en linkk</a></b></p>

More reference about CSS Link: CSS Styling

    
answered by 13.06.2017 в 22:39