【问题标题】:Navigation bounces on first and last li link in IE 6 only导航仅在 IE 6 中的第一个和最后一个 li 链接上反弹
【发布时间】:2011-12-09 06:04:13
【问题描述】:

我在 IE 6 中的导航遇到了一个奇怪的问题。当鼠标悬停在上面时,只有导航的第一个和最后一个链接会反弹。

为什么会这样?

我的 CSS 文件:

#navigation {
    width: 930px;
    height: 30px;
    background-color: #f1faff;
    text-align:center;
}

#navigation  ul {
    margin: 0px;
    padding: 0px;
    list-style: none;
    line-height: 30px;
}

#navigation  ul li {
    display: inline;
}

#navigation  ul li a {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: #0067b4;
    display: inline;
    text-decoration: none;
    text-transform: uppercase;
    padding: 7px 50px;
}

#navigation  ul li a:hover {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: #5e5e5e;
    display: inline;
    text-decoration: none;
    text-transform: uppercase;
    padding: 7px 50px;
}

#navigation  ul li a.first {
    padding-left: 8px;
    margin: 0px;
    overflow: hidden;
    border: 0px;
}

#navigation  ul li a.last {
    padding-right: 8px;
    margin: 0px;
    overflow: hidden;
    border: 0px;
}

发生这种情况的网站可通过http://www.paysonsecure.com/protekskiracing/获得

【问题讨论】:

    标签: css internet-explorer-6


    【解决方案1】:

    我会将其添加到您的 global-ie6.css 中

    #navigation ul { 显示:内联块; }

    【讨论】:

      【解决方案2】:

      谢谢gutierrezalex!我遇到了同样的问题,它可以在我的样式中添加 {display: inline-block;} ..它适用于任何浏览器:

      ul.menu li a{
          text-decoration:none;
          color:black;
          display:block;
          padding:0;
          margin:0;
          display:inline-block;
         }
      
      ul.menu li a:hover{
         background-color:#5cc2ed;
         color:#ffffff;
         display:inline-block;
        }
      

      【讨论】:

      • 欢迎来到 Stack Overflow,sid!看起来我在你还在修改的时候碰到了你的帖子;对于那个很抱歉。仅供参考,反引号用于添加内联代码;缩进四个空格表示代码块。我们也不鼓励在此处的帖子中说“谢谢”(或“嗨”或“我有问题”)。这是一个专业的社区,因此假定礼貌,这样信噪比就保持高。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-02-16
      • 2011-04-26
      • 1970-01-01
      • 1970-01-01
      • 2013-08-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多