IE7 Dropdown Menu Issue
I've got a dropdown menu setup. Works fine in Firefox / IE8 etc. But not in IE7, Ideally I would like to get this to work. The menu dissapears when I hover over it in IE7. I've tried playing about with the height but had no joy.
My code is as follows...
CSS..
#topNav ul {
list-style:none outside none;
margin:0;
padding:0;
}
#topNav ul, topnav ul ul {
display:block;
margin:0;
padding:0;
}
#topNav ul li {
display:inline;
float:left;
padding:35px 24px;
list-style:none outside none;
position:relative;
}
#topNav ul li ul {
color:#000000;
display:block;
position:absolute;
top: 68px;
visibility:hidden;
width:180px;
z-index:1000;
height: 200px;
}
#topNav ul .home a, #topNav ul .coffeetable a, #topNav .coffeetable a, #topNav .audio a, #topNav .graphic a {
color:#ff9966;
}
#topNav ul .photography a, #topNav ul .video a, #topNav ul .web a, #topNav ul .contact a {
color: #fff;
}
#topNav ul li ul li {
color:#FF7E00;
display:block;
margin:0 0 5px;
padding:15px;
width: 240px;
}
#topNav ul li ul li a {
color:#000000;
display:block;
margin:0;
padding:5px;
}
#topNav ul li.submenu:hover ul {
left:0;
visibility:visible;
}
#topNav ul li.submenu:hover ul li {
background-color: #000;
margin:0;
padding: 10px 10px;
}
HTML...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The Picturebook Studio Ltd.</title>
<!--[if IE]>
<style type="text/css" media="screen">
body {behavior: url(includes/csshover.htc);}
</style>
<![endif]-->
<link href="css/styles.css" rel="stylesheet" type="text/css" />
<script src="js/cufon-yui.js" type="text/javascript"></script>
<script src="js/Kozuka_Gothic_Pro_OpenType_400-Kozuka_Gothic_Pro_OpenType_700.font.js" type="text/javascript"></script>
<script type=开发者_Go百科"text/javascript">
Cufon.replace('li');
Cufon.replace('h1');
Cufon.replace('p');
Cufon.replace('ol li');
</script>
</head>
<body>
<?php include('includes/header.php'); ?>
<div id="logo">
<img src="images/logo.png" alt="The Picturebook Studio Ltd" />
</div>
<div id="content">
<h1>Welcome to the picturebook studio limited <br />
</h1>
<p class="whiteParagraph">We employ a team of in house professionals which include:</p>
<ol>
<li>photographers</li>
<li>videographers</li>
<li>sound engineers</li>
<li>graphic designers</li>
<li>web designers</li>
</ol>
<p>We provide the following 'unique' services :</p>
</div>
</body>
</html>
Included NAV File....
<div id="topNav">
<ul>
<li class="home"><a href="#" title="Home">home</a></li>
<li class="submenu photography">
<a href="#" title="Photography">photography</a>
<ul>
<li><a href="#" title="Actors / Presenters / Headshots">Actors / Presenters Headshots</a></li>
<li><a href="#" title="Model / Portfolio Shoots">Model / Portfolio Shoots</a></li>
<li><a href="#" title="People / Portraits">People / Portraits</a></li>
<li><a href="#" title="Wedings / Coffee Table Books">Weddings / Coffee Table Books</a></li>
<li><a href="#" title="Editorial / Commercial">Editorial / Commercial</a></li>
</ul>
</li>
<li class="coffeetable"><a href="#" title="coffee table books">coffee table books</a></li>
<li class="submenu video">
<a href="#" title="video production">video production</a>
<ul>
<li><a href="#" title="Actors / Presenters Showreels">Actors / Presenters Showreels</a></li>
<li><a href="#" title="Corporate">Corporate</a></li>
<li><a href="#" title="Industrial">Industrial</a></li>
<li><a href="#" title="Training Education">Training Education</a></li>
<li><a href="#" title="Weddings">Weddings</a></li>
</ul>
</li>
<li class="submenu audio">
<a href="#" title="audio production">audio production</a>
<ul>
<li><a href="#" title="Voice Over">Voice Over</a></li>
<li><a href="#" title="Music Production">Music Production</a></li>
</ul>
</li>
<li class="web"><a href="#" title="web design">web design</a></li>
<li class="submenu graphic">
<a href="#" title="graphic design">graphic design</a>
<ul>
<li><a href="#" title="PR">PR</a></li>
<li><a href="#" title="Logo Design">Logo Design</a></li>
</ul>
</li>
<li class="contact"><a href="#" title="contact us">contact us</a></li>
</ul>
</div>
How can I fix this so that the hover doesnt break? Thanks in advance guys.
If that's the case...All I can suggest is to double check to make sure your browser & document modes are definitely in IE7 mode, read up about IE7 Z-index approaches. trial and error css position types, I believe there's some glitches with IE7 to do with css display types (hidden).
clean up your CSS, I know everyone will be like "what" but sometimes you find nice fixes when you remove errors as some browsers are more sensitive & strict to things like spaces around selectors, commas etc.
If all of that doesn't work and you scale the web looking for a solution, and you find nothing. Just make an IE7 redirect (you can do this without JS), IE7 is not worth the stress unless your client & clients clients are frequent users of IE7 such as tight ass corporations who don't want to upgrade.
Hope that helps
(sorry I only looked at your code for 2 seconds)
精彩评论