Jump to content

[SOLVED] cannot figure this out .. a:link / hover / visited problem


severndigital

Recommended Posts

I know this is probably very simple but i have always had a problem getting this to work. I am hoping to solve this problem forever today :)

 

 

i created some css information see below

.menubar {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
color: #336699;
}
.menubar a:link {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
color: #336699;
text-decoration: none;
}
.menubar a:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
color: #336699;
text-decoration: underline;
}

 

nothing fancy .. very simple. however,

 

when i test the code in the browser (firefox and IE) the links turn purple and become underlined after i click them.

 

I tried adding visited and active css to the code to try and defeat it. see below

 

.menubar {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
color: #336699;
}
.menubar a:link {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
color: #336699;
text-decoration: none;
}
.menubar a:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
color: #336699;
text-decoration: underline;
}
.menubar a:visited {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
color: #336699;
text-decoration: none;
}
.menubar a:active {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
color: #336699;
text-decoration: none;
}

 

when i do that the purple underlined goes away, but i no longer get the underline on roll over.

 

this is sooooo frustrating.

 

can anyone shed some light on this for me.

 

thank you,

chris

 

 

 

 

Link to comment
Share on other sites

I'd just add that your code would be better off looking like this

 

.menubar, .menubar a, .menubar a:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
color: #336699;
}

.menubar a {
text-decoration: none;
}

.menubar a:hover {
text-decoration: underline;
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.