Jump to content

Class not working in Firefox

Recommended Posts

I've set two different classes for my links. It works in Chrome and IE, but not Firefox.The css is:

a.one:link,a:visited{display:inline-block;font-weight:bold;color:#FFFFFF;background-color:#787A00;width:105px;vertical-align: center;text-align:center;padding:4px;text-decoration:none;border-left:5px solid #4B4B38;}a.one:hover,a:active{background-color:#4B4B38;border-left:5px solid #787A00;}a.two:link,a:visited{display:inline-block;font-weight:bold;color:#FFFFFF;background-color:#787A00;width:116px;text-align:center;padding:0px;text-decoration:none;border-left:5px solid #5C5E00;}a.two:hover,a:active{background-color:#4B4B38;border-left:5px solid #66664F;}

the width and padding for a.one are replaced the the width and padding of a.two

Edited by Dire_Wolf

Share this post

Link to post
Share on other sites

Because you need to add the class name to the a:active and a:visited pseudo classes, when you click these anchors it will search for the last relative css styling, which would be.a.two:link,a:visited{display:inline-block;font-weight:bold;color:#FFFFFF;background-color:#787A00;width:116px;text-align:center;padding:0px;text-decoration:none;border-left:5px solid #5C5E00;}a.two:hover,a:active{background-color:#4B4B38;border-left:5px solid #66664F;}changing toa.one:link,a.one:visited{...}a.one:hover,a.one:active{...}a.two:link,a.two:visited{...}a.two:hover,a.two:active{...}should fix this problem.Also FF for security reasons, will/has prevented the changing of stying for visited links (mainly images), except for basic styling (text color, underline, borders), to prevent hackers identifying which sites users have visited.

Edited by dsonesuk

Share this post

Link to post
Share on other sites

Join the conversation

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

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...