html - 简单的菜单。 CSS 在 IE7 中不工作

标签 html css

我有以下菜单。似乎适用于所有浏览器,但不适用于 IE6 或 IE7。是什么导致了问题,我该如何解决。

http://jsfiddle.net/2ysCC/ 查看工作示例

#menu_wrap {
    margin-top:20px auto 0 auto;
    padding:0;
    width:780px;
    height:40px;
    list-style-type:none;
}
.button a {
    cursor:pointer;
    text-align:center;
    font:13px/100% Arial, Helvetica, sans-serif;
    font-weight:bold;
    position:relative;
    min-width:50px;
    height:20px;
    float:left;
    padding:10px;
    padding-right:0;
    text-decoration:none;
}

.Red, .Red .button a {
    color:#faddde;
    background: #ed1c24;
}
.button:last-child a {
    float:left;
    border:none;
}

<ul id="menu_wrap" class="Red">
  <li class="button"><a href="#">Home</a></li>
  <li class="button"><a href="#">portfolio</a></li>
  <li class="button"><a href="#">Latest</a></li>
</ul>

这是它在 IE7 中的样子 enter image description here

最佳答案

添加“显示:内联;”给你的'li'。

#menu_wrap .button {
  display: inline;
}

这是一篇更详细地描述错误的文章:http://css-tricks.com/501-prevent-menu-stepdown/

关于html - 简单的菜单。 CSS 在 IE7 中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7900265/

相关文章:

javascript - 如何使用 react 形式设置选择值并循环遍历数组

javascript - 菜单打开后H1不隐藏

javascript - jquery 表单验证不适用于复选框

css - 背景图像未显示在 IE8 Drupal 7 Zen Subtheme 中

css - 当我的链接(icofont)在 4 中处于事件 Angular 时,如何添加颜色?

javascript - 选择选项并隐藏 div jquery

html - 行内容需要垂直居中对齐

css - 用于上传重叠在按钮上方的图像的 span 元素

css - Wordpress 更改字体

jQueryUI 自动完成 : how to use 'first-of-type' and 'last-of-type' with #ui-active-menuitem?