水平 CSS 导航在 IE7 中显示为垂直

发布于 2024-12-11 14:28:24 字数 2722 浏览 0 评论 0原文

http://www.sage-wellness.com/nav.html

我正在IE7 中存在此问题 - 所有顶级导航都是垂直堆叠而不是水平堆叠。

这是 CSS

#navigation { width:800px; height:27px; background-image:url(images/navbg.gif); background-   repeat:no-repeat; margin-top:30px; }
#navigation ul { margin:0px; padding:0px;  font-family: Arial, Helvetica, sans-serif; font-size: 12px;line-height: 27px; display:inline; }
#navigation ul li { display:inline; float:left; list-style:none; height:27px; line-height:27px; position:relative; }
#navigation li a { color:#a1c301; text-decoration:none; padding-right:10px; padding-left:10px; }
#navigation  li a:hover, #navigation li:hover a { color:#fff; background-color: #91b000; display:inline-block; }

#navigation li ul { margin:0px; padding:0px;  display:none; position:absolute; left:0px; top:27px; background-color:#5b5b52;}
#navigation li:hover ul { display:block; width:150px;}
#navigation li li a { color:#a1c301; text-decoration:none; }
#navigation li li a:hover, #navigation li li:hover a { color:#fff; background-color: #91b000; width:130px; display:inline-block;}
#navigation li.top { }
#navigation li.top a:hover { }
#navigation ul.submenu { background-color:#5b5b52;  }
#navigation li.submenu { width:150px; border: 1px dotted #999; background-color:#5b5b52; }
#navigation .submenu li a { background:#5b5b52; }

,这是 HTML

<div id="navigation">
<ul class="top">
<li class="top">&nbsp;&nbsp;&nbsp;&nbsp;</li>
<li class="top"><a href="">Home</a></li>
<li class="top"><a href="">Acupuncture</a></li>
<li class="top"><a href="">Chinese Medicine</a>
  <ul class="submenu">
        <li class="submenu"><a href="">Herbal Medicine</a></li>
        <li class="submenu"><a href="">Other Modalities</a></li>
    </ul>
</li>
<li class="top"><a href="">Conditions Treated</a></li>
<li class="top"><a href="">About</a>
 <ul class="submenu">
        <li class="submenu"><a href="">Deb Valentin Bio</a></li>
        <li class="submenu"><a href="">FAQs</a></li>
        <li class="submenu"><a href="">Community Resources</a></li>

    </ul>
   </li>
 <li class="top"><a href="">Testimonials</a></li>
<li class="top"><a href="">Blog</a></li>
<li class="top"><a href="">Schedule an Appointment</a></li>
</ul>
</div>

http://www.sage-wellness.com/nav.html

I am having a problem with this in IE7- all of the top-level navigation is stacked vertically instead of horizontally.

Here is the CSS

#navigation { width:800px; height:27px; background-image:url(images/navbg.gif); background-   repeat:no-repeat; margin-top:30px; }
#navigation ul { margin:0px; padding:0px;  font-family: Arial, Helvetica, sans-serif; font-size: 12px;line-height: 27px; display:inline; }
#navigation ul li { display:inline; float:left; list-style:none; height:27px; line-height:27px; position:relative; }
#navigation li a { color:#a1c301; text-decoration:none; padding-right:10px; padding-left:10px; }
#navigation  li a:hover, #navigation li:hover a { color:#fff; background-color: #91b000; display:inline-block; }

#navigation li ul { margin:0px; padding:0px;  display:none; position:absolute; left:0px; top:27px; background-color:#5b5b52;}
#navigation li:hover ul { display:block; width:150px;}
#navigation li li a { color:#a1c301; text-decoration:none; }
#navigation li li a:hover, #navigation li li:hover a { color:#fff; background-color: #91b000; width:130px; display:inline-block;}
#navigation li.top { }
#navigation li.top a:hover { }
#navigation ul.submenu { background-color:#5b5b52;  }
#navigation li.submenu { width:150px; border: 1px dotted #999; background-color:#5b5b52; }
#navigation .submenu li a { background:#5b5b52; }

and here is the HTML

<div id="navigation">
<ul class="top">
<li class="top">    </li>
<li class="top"><a href="">Home</a></li>
<li class="top"><a href="">Acupuncture</a></li>
<li class="top"><a href="">Chinese Medicine</a>
  <ul class="submenu">
        <li class="submenu"><a href="">Herbal Medicine</a></li>
        <li class="submenu"><a href="">Other Modalities</a></li>
    </ul>
</li>
<li class="top"><a href="">Conditions Treated</a></li>
<li class="top"><a href="">About</a>
 <ul class="submenu">
        <li class="submenu"><a href="">Deb Valentin Bio</a></li>
        <li class="submenu"><a href="">FAQs</a></li>
        <li class="submenu"><a href="">Community Resources</a></li>

    </ul>
   </li>
 <li class="top"><a href="">Testimonials</a></li>
<li class="top"><a href="">Blog</a></li>
<li class="top"><a href="">Schedule an Appointment</a></li>
</ul>
</div>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

2024-12-18 14:28:24

ie7 不理解 :hover 在锚点以外的元素上,也不知道 display:inline-block 的含义。查看 suckerfish 下拉菜单以获取解决方案 http://www.htmldog.com/articles/suckerfish/dropdowns /

ie7 doesn't understand :hover on elements other than anchors, as well as has no clue what display:inline-block means. check out suckerfish dropdowns for a solution http://www.htmldog.com/articles/suckerfish/dropdowns/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文