Menu a.hover issue

Hi All, I have been working on my works site. I set-up a one page site with local scroll and am in the process of breaking the site up into multiple pages. I’m running into an issue with my menu.

Basically I have local scrollto links such as “#about” and links to external pages in the menu. The links are white and yellow on mouse over. My external links seem to have an issue where when you hover they turn yellow but only for a second before it changes back to white. The local scroll links work as expected. Any ideas? let me know what I need to provide you guys to figure this out.

Thank you,
defeater

Well a codepen/jsfiddle/website would help since we would only be shooting in the dark :slight_smile: .

Website is kdsignsystems.com

Problem menu links are products and blog

works fine for me. What browser/operating system are you using?

Yup fine for me too. Clear your cache maybe?

It works as excepted in chrome but not firefox. Even after clearing my cache.

FF35 is working.

Very Strange. I have FF36.

Just to be certain it’s the products and blog links that are acting up.

FF36 fine.

We are just hovering right? Like you said?

THose links are fine.

Ya, just hovering. Well I’m even more confused than ever now. haha Well thanks for your help…

Firefox 36 on Ubuntu Gnome 14.10.

I didn’t see the problem at first, then clicked through a couple of pages. On the “Products” page, the issue occurred, affecting the “Home” and “Blog” links. When I returned to the “Home” page, then the “Products” and “Blog” links were affected.

I didn’t have time to look closely, but I’m guessing your visited styles are over-riding your hover styles.

I’m seeing it more on Chrome now too.

So look at this rule “.mainnav .menu a{}”. That sets the color for all anchors that meet that description. Along with all pseudo classes. That means that it sets the :hover pseudo class as well.

However your hover rules are set like this “.mainnav a:hover{}.”

Due to specificity, your hover rules aren’t enough to override your “.mainnav .menu a{}” rule. You need to change your hover to match that specificity. E.g. .mainnav .menu a:hover{}.

Good catch - it’s a specificity issue. If I add this line in, then it works, so your hover link must be more generic.

.mainnav .menu a:hover{
 color: purple;	
}

Your ridiculously large highlight color css statement needs that added to it.

Thanks Dave, that worked! I would have never figured that out.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.