html - CSS - 下拉效果不适用于 IE-8

标签 html css internet-explorer

我无法让这段代码在 IE-8 上正常工作。抱歉,我是 CSS 初学者。

 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid        /ns#">
   <head>
       <meta name="generator" content= "HTML Tidy for Linux/x86 (vers 25 March 2009), see www.w3.org" />
       <meta content="text/html; charset=us-ascii" http-equiv="Content-Type"/>
       <link href="/site_media/css-dock-menu/style.css" rel="stylesheet" type="text/css" />
       <link rel="stylesheet" type="text/css" href="/site_media/css/new.css"/>
   </head>
   </body>
       <ul class="navbar">
         <li style="width:9%;">
            <a href="#">Useful Sites</a>
              <ul>
                  <li><a href="default1.aspx">Portal</a></li>
                  <li><a href="default2.aspx">Calender</a></li>
              </ul>
         </li>
         <li>
          [....] 

基本上,将鼠标悬停在“有用的网站”上应该会显示包含“门户”和“日历”的下拉菜单。

这是我的 new.css -

#wrap   {
        width: 100%; 
        height: 30px;
        margin: 0; 
        z-index: 99; 
        position: relative;
        background-color: #366b82;
        }

.navbar {
        height: 20px;
        padding: 0;
        width: 100%;
        left-margin: 0;
        position: absolute; 
        right: 0;

        }

.navbar li {
                        height: auto;
                        width: 125px;  
                        float: left;  
                        list-style: none;  
            }

.navbar a       {
                padding: 10px 0;  
                border-left: 1px solid #54879d;
                border-right: 1px solid #1f5065; 
                text-decoration: none; 
                color: white; 
                display: block;
                }

.navbar li ul   {
                display: none; 
                height: auto;
                margin: 0;
                padding: 0; 
                }

.navbar li:hover ul     {
                        display: block; /* Displays the drop-down box when the menu item is hovered over */
                        }

提前致谢!

最佳答案

你需要如下

.navbar li a:hover ul 
 {
  display: block; /* Displays the drop-down box when the menu item is hovered over */
 }

关于html - CSS - 下拉效果不适用于 IE-8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20493887/

相关文章:

css - 制作 :active work at the children node in IE

css - z-index 不适用于 Internet Explorer 8

css - 在 Internet Explorer 中使用样式的 Dojo TabContainer

java - 如何提取 key :value from html

html - 交换我的内容和侧边栏的位置?

html - 跨在一条 anchor 中

css - 使用 sprite 图像背景时断开文本到底部的链接

html - 如何在子 div 之间划分父 div 的宽度(一个自动大小和一个固定大小)?

html - 事件菜单项上向下的箭头

html - 跨越多行