Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-05-2013, 04:24 AM   PM User | #1
SRD75
Regular Coder

 
Join Date: Sep 2011
Posts: 148
Thanks: 28
Thanked 1 Time in 1 Post
SRD75 is an unknown quantity at this point
A:Hover background image not showing

This site has a navigation menu who's elements I want to have a background image display on hover, or when the page is active.

On line 1428 of style.css, I have:

Code:
.main-navigation li a:hover, .main-navigation li a:current, .main-navigation li a:active {
   background: url(images/menu_hover.jpg) repeat-x top;
}
This doesn't work.

It does work if I apply the background image to a:link, so the image URL is correct.

Why isn't it working for a:hover, a:current, a:active?

Last edited by SRD75; 02-05-2013 at 04:27 AM..
SRD75 is offline   Reply With Quote
Old 02-05-2013, 04:26 AM   PM User | #2
aaronhockey_09
Regular Coder

 
Join Date: Dec 2010
Posts: 411
Thanks: 21
Thanked 55 Times in 55 Posts
aaronhockey_09 is an unknown quantity at this point
Can you post a link for us to see ?
Can't really help with only that,
Although your use of a:current is not correct. It should be a.current, or a:active

If you could post a URL that would help alot.


SORRY
didnt see the link
Looking at it now
aaronhockey_09 is offline   Reply With Quote
Old 02-05-2013, 04:36 AM   PM User | #3
aaronhockey_09
Regular Coder

 
Join Date: Dec 2010
Posts: 411
Thanks: 21
Thanked 55 Times in 55 Posts
aaronhockey_09 is an unknown quantity at this point
I believe it is because of the .main-navigation li a:current,

Because when i add the same background code, into where you have defined the colour

Code:
.main-navigation li a:hover {
It works just fine.
Try this.

Code:
.main-navigation li a:hover, .main-navigation li.current-menu-item:hover a {
		background: url(images/menu_hover.jpg) repeat-x top;
	}
That should do the trick
What we are doing is calling class for the current LI for the current tabs, and keeping the hover the same

Hope this helps.
aaronhockey_09 is offline   Reply With Quote
Users who have thanked aaronhockey_09 for this post:
SRD75 (02-06-2013)
Old 02-06-2013, 06:59 AM   PM User | #4
SRD75
Regular Coder

 
Join Date: Sep 2011
Posts: 148
Thanks: 28
Thanked 1 Time in 1 Post
SRD75 is an unknown quantity at this point
Thanks Aaron!
SRD75 is offline   Reply With Quote
Reply

Bookmarks

Tags
css

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:15 AM.


Advertisement
Log in to turn off these ads.