Solved

li hover background url code not working IE for my nav mouseovers.

Posted on 2008-06-21
8
1,792 Views
Last Modified: 2013-12-08
li hover background url code not working IE for my nav mouseovers.  It works in FF, but not in IE7.
You can test it here
http://216.83.111.120/awn-oscmax

Just mouseover the top nav buttons...ie. Home, contact us etc.

In FF, the BG image loads but in IE it doesn't.  Below is the code I'm using which is not working.

I was just wondering if someone could let me know what the right code is.  I've searched all over the web to no avail.

Thanks!
ul#toplinks li:hover
{
	background:url(images/top_li_hover_bg.jpg);
    background-repeat: repeat-x;
}

Open in new window

0
Comment
Question by:allwebnow
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 49

Accepted Solution

by:
Roonaan earned 250 total points
ID: 21838764
Internet explorer does not support :hover on any tags other than the <a>

You could choose for using <li onmouseover="this.className='hover'" onmouseout="this.className='';"> and use li.hover instead.
0
 

Author Comment

by:allwebnow
ID: 21839019
hmm
the <li> tag is in php.  I don't know how that semi colon will work with that ;
0
 

Author Comment

by:allwebnow
ID: 21839037
Ok, i added this to the php <li> tag and it;/'s not working:

'<li onmouseover="this.className=\'hover\'" onmouseout="this.className=\'\';"><a href="' . tep_href_link(FILENAME_DEFAULT) . '"><span>Home</span></a></li>'
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 49

Expert Comment

by:Roonaan
ID: 21840194
Have you changed your css as well?
0
 

Author Comment

by:allwebnow
ID: 21840748
what do I change in the css?
0
 
LVL 49

Expert Comment

by:Roonaan
ID: 21840849
use li.hover instead of li:hover.
0
 

Author Comment

by:allwebnow
ID: 21840863
Ok, I changed that, now neither browsers are working.

This is what I have in CSS:

div#toplinks
{
	margin:10px auto auto 10px;
}
 
ul#toplinks
{
	width:100%;
	height:40px;
	background:#FAFAFA url(images/top_ul_bg.jpg) repeat-x;
	list-style:none;
	padding:0px;
	margin:0px;
}
 
ul#toplinks li
{
	float:left;
	padding-right:15px;
	padding-left:15px;
	background:url(images/top_li_bg.jpg) no-repeat top right;	
}
 
ul#toplinks li.hover
{
	background:url(images/top_li_hover_bg.jpg);
    background-repeat: repeat-x;
 
}
 
ul#toplinks li a
{
	display:block;
	text-decoration:none;
	color:#2667C1;
	font-weight:bold;
	margin-top:14px;
	
}
 
ul#toplinks li a:hover{ color:#000000; 	text-decoration:underline	}
/* end page layout */

Open in new window

0
 

Author Comment

by:allwebnow
ID: 21843021
I got it working!  Thanks
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Bootstrap list items overlap 3 36
upgrade exchange 2013 CU7 to CU15 9 57
Mail Server IP address 2 28
Exchange Cluster Requirements 8 24
Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
As cyber crime continues to grow in both numbers and sophistication, a troubling trend of optimization has emerged over the last year.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question