Change color of an anchor link

hello!

how to change color to an ancor link

thanks galia

One way is to add a class to the tag you want to change, eg

<a href="#" class="myclass">Linky</a>

Then apply some CSS as required, eg…

.myclass:link { color: #FF0000; }
.myclass:visited { color: #666666; }
.myclass:hover { color: #FFA500; }
.myclass:active { color: #0000FF; }
.myclass:focus { color: #00FF00; }

hello!

ok i will try thanks

galia

@nono29 - remember, you already have classes on your links. You can simply add the styles to your existing classes.

hello!
it does not work
i try just the first `.highlight:link {color:#f00;} it change the color but just on the softwere and then i write the all code that he gave to me and there no color after saving
sending code

}

.highlight:link {color:#f00;}
.highlight:visited {color:#f00:}
.highlight: hover {color:#f00;}
.highlight:active {color:#F00;}
.highlight:focus {color:#F00;}
}
and what is e.g

thanks galia

You have a link to the page?

It’s an abbreviation which means “for example”.

If you want those links to be red at all times, which seems to be what you’re saying with that code, then you could simplify it and just add color:#F00 to your highlight class.

If that’s not what you want, then please show the HTML code for the links so we can see exactly how it’s structured. Otherwise, we’re just guessing how best to target the links.

hello!

i whant that the links will be the same color that in the word in the first image.
sending the code page

the image

thanks galia

The code you were trying to use in post #5 says you want those links to be red at all times - before they’ve been visited, after they’ve been visited, if you hover over them - always red.

If that’s really what you want, then delete those styles and simply add color: #F00 to the highlight class, as I suggested.

(I only wanted to see the HTML for those links. It would have been much easier in this case for you to post just the relevant part here, rather than post a JSfiddle. Your whole code is lengthy and messy, and it’s not easy to pickout the relevant sections.)

hello!

it change the color it works but how to change the color to (see image) it doesnt work the same i erased what i tried to do
sending image


thanks galia

What is the class of the anchors in that menu? Simply do the same as you did with the highlight class

hello!

i try with sign class that is the class that the links have and it did not works

thanks galia

You have de class assigned to the td

<td width="162" height="20" class="sign"><a href="#top">באנר מוסיקה</a></a></td>

You should assign it to the anchor

<td width="162" height="20"><a href="#top" class="sign">באנר מוסיקה</a></a></td>

Do you mean that you want to change the colour of all the links on this page to red?

Or do you mean that you want your red links to become purple after you have clicked them?

(And in the code which donboe has quoted in the post above this, you have an extra </a> tag which should be removed.)

hello!

i try the code that you gave to me and and it not look good on the browser
see image

the code

td width="162" height="20" class="sign"><a href="#top">באנר מוסיקה</a></a></td>

thanks galia

Like TechnoBear mentioned you should remove the second closing a tag

<td width="162" height="20" class="sign"><a href="#top">באנר מוסיקה</a></a></td>

should become

<td width="162" height="20" class="sign"><a href="#top">באנר מוסיקה</a></td>

hello!

The mess worked out but I still can not change the color

sending code

.sign {
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
font-style: normal;
font-weight: bolder;
color: #690917;
text-align: center;
white-space: nowrap;
color:#F00;

}
The code now

 <td width="162" height="20" class="sign"><a href="#top">באנר מוסיקה</a></td>

thanks galia

@nono29 - I can’t help as I don’t know what you’re trying to achieve. Please answer the questions I asked in post #14.

You have this colour set:

and then a few lines later, this colour:

Choose which colour you would like, and delete the other line.

hello!
i whant that all of my links will be in the color #651023

thanks galia