IE7下拉菜单问题

时间:2011-02-15 23:07:50

标签: css xhtml internet-explorer-7

我有一个下拉菜单设置。在Firefox / IE8等中工作正常。但是在IE7中没有,理想情况下我想让它工作。当我在IE7中将鼠标悬停在菜单上时,菜单消失了。我已经尝试过玩弄身高但没有快乐。

我的代码如下......

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="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>

包含资产净值文件......

<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>

如何修复此问题以便悬停不会破坏?先谢谢你们。

1 个答案:

答案 0 :(得分:0)

如果是这样的话...我所能建议的是仔细检查以确保您的浏览器&amp;文档模式肯定是在IE7模式下,阅读有关IE7 Z-index的方法。试验和错误css位置类型,我相信IE7与css显示类型(隐藏)有一些故障。

清理你的CSS,我知道每个人都会像“什么”一样,但有时你会在删除错误时找到很好的修复,因为某些浏览器更敏感&amp;对选择器,逗号等周围的空间严格要求。

如果所有这些都不起作用,您可以扩展网络以寻找解决方案,而您什么都找不到。只需进行IE7重定向(你可以在没有JS的情况下做到这一点),除非你的客户端&amp;客户端客户是IE7的常用用户,例如不想升级的紧身公司。

希望有所帮助

(抱歉,我只看了你的代码2秒)