Jacob Anthony Tonna
Jacob Anthony Tonna

Reputation: 525

Html Link Changes Color? No Explination

<style>
a.a:link,a.a:visited
{
display:block;
width:120px;
font-weight:bold;
color:#ff7100;
background-color:#98bf21;
text-align:center;
padding:4px;
text-decoration:none;
text-transform:uppercase;
}
</style>

<a class='a' href="">link</a>

for some reason when color:#ff7100; gets another # when the link is clicked it changed to orange then sends you to the page u linked to but if the extra # is not there its just another normal link.. i find this strange because i have never seen this before any one have an explination?

Upvotes: 1

Views: 163

Answers (1)

XCS
XCS

Reputation: 28137

That should be <style> not <script> . You should not use empty href tags, the usual is to use # instead (empty hashtag).

That may be because when you click on a lick it actually goes in its active state, so you also have to define css for a:active

Try this selector instead:

a.a:link,a.a:visited,a.a:active,a.a:hover

Upvotes: 1

Related Questions