Click here to Skip to main content
15,908,445 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
li:hover in IE browser not identify?
this code is run in fire Fox but not Run in IE
Please Help me
Thanks A lot



HTML
<html>
<head>
<style>
#nav,#nav ul
{
padding:0;
margin:0;
list-style:none;
}
#nav li
{
float:left;
position:relative;
width:200px;
border:1px solid #B0C4DE;
background-color: #E7EDF5;
color:#2D486C;
}
a
{
text-decoration:none;
}
#nav ul
{
position:absolute;
}
#nav li ul
{
visibility:hidden;
}
#nav li:hover ul
{
visibility:visible;
opacity:0.6;
}

</style>
</head>


<body>
<ul id="nav">
	<li><a href="#">menu1</a>
		<ul>

			<li><a href="#">sub1Menu1</a></li>
			<li><a href="#">sub2Menu1</a></li>
			<li><a href="#">sub3Menu1</a></li>
		</ul>
	</li>
	<li><a href="#">menu2</a>
		<ul>
			<li><a href="#">sub1Menu2</a></li>
			<li><a href="#">sub2Menu2</a></li>
			<li><a href="#">sub3Menu2</a></li>
		</ul>
	</li>
		
</ul>		

</body>
</html>
Posted
Updated 12-Jul-12 10:02am
v2
Comments
Karthik. A 12-Jul-12 16:07pm    
Which version of IE are you trying this? I tried using chrome & IE 7/8/9. It works in all 3. Just that its messed up in IE 7, but I really wouldn't bother. I used this fiddle to verify - http://jsfiddle.net/VzAk7/
Seyed Ahmad Mirzaee 12-Jul-12 16:27pm    
i Test this Code In IE8
but SubMenu is not Visible When Li:Hover Occured!!!

1 solution

Add this to the top of the page
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 
Share this answer
 
v2
Comments
Seyed Ahmad Mirzaee 13-Jul-12 9:07am    
thanks very much
can you explain For me what happen when add this to the top of the page?
thanks
AshishChaudha 13-Jul-12 9:36am    
mark it as your answer.if your issue is resolved..so that other can refer to the solution.
Thanks
nirangad 14-Jul-12 1:42am    
You can read more about the DOCTYPE :) :)

http://www.w3.org/QA/Tips/Doctype
http://www.w3schools.com/tags/tag_doctype.asp
AshishChaudha 13-Jul-12 9:35am    
my 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900