PDA

View Full Version : Changing text color for selectedanchor in anylinkmenu.css



bloch
01-23-2010, 06:30 PM
1) Script Title: AnyLink JS Drop Down Menu v2.2

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm

Hello

I saw that a few other have asked this question as well but seem not to have followed through.

The menu works fine, but the text-color reverts to default if I'm on the drop down menu, soi I thought I can change this behavior in the anylinkmenu.css for the selectedanchor just with 'color. #6666'


.selectedanchor{ /*CSS class that gets added to the currently selected anchor link (assuming it's a text link)*/
background: #ffffff;
font-size: 11px;
color: #666666;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
text-decoration: none;
}

However, this doesn't seem to work at all. The link behaviour should be as follow: Black as initial state, and on both hover/active when drop down menu is open, set to dark grey.

I'm working with two kinds of link behaviours on the same page, and the one that is attached to the menuanchorclass is this one:


<style type="text/css">
.mainnavi {
font-size: 11px;
text-weight: normal;
text-decoration: none;
color: #000000;
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
}
a.mainnavi:link { font-family: Arial, Helvetica, sans-serif; font-size: 11px; text-decoration: none; color: #000000}
a.mainnavi:active { font-family: Arial, Helvetica, sans-serif; font-size: 11px; text-decoration: none; color: #666666}
a.mainnavi:visited { font-family: Arial, Helvetica, sans-serif; font-size: 11px; text-decoration: none; color: #000000}
a.mainnavi:hover { font-family: Arial, Helvetica, sans-serif; font-size: 11px; text-decoration: none; color: #666666}
</style>

This one's internal on every page, and that's what I'm trying to achieve, that, when I select links from within the drop down menu, the original link stays dark grey as well.

Any help would be truly appreciated.

Bloch

bloch
01-24-2010, 09:53 PM
No go? Changing the background color works fine, but there's obviously something I miss changing the font color when link is triggered and drop down menu is open?

ddadmin
01-25-2010, 07:31 AM
Have you tried using CSS's !important keyword to make sure the style you want applied takes precedence over all else? For example:


.selectedanchor{ /*CSS class that gets added to the currently selected anchor link (assuming it's a text link)*/
background: #ffffff;
font-size: 11px;
color: #666666 !important;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
text-decoration: none;
}

bloch
01-25-2010, 01:02 PM
That did the trick! Thank you so much for taking the time having a look. Honestly, I've never heard of this !important keyword before.

Thank you again!
bloch