css - Chrome 11 解析 CSS 规则的错误

标签 css debugging google-chrome bug-tracking

我有这个 slider :

enter image description here

而且它在几乎所有浏览器(Firefox、Opera、Safari,甚至是设计 killer 浏览器 IE)中都非常有效。但是在 Chrome 11(我必须支持这个版本的 Chrome)和更低版本中,右键会掉下来。我一直在追踪它为什么会这样,我发现了一些非常有趣但同时又很烦人的东西。对于我的左右按钮,我有一个非常简单的 CSS 规则:

#rightBtn
{
    background: url(/images/rightBtn.png) 0 0 no-repeat;
    width: 56px;
    height: 56px;
    display: block;
    float: right;
    margin-top: 100px;
    cursor: pointer;
    margin-right: -60px;
}

#leftBtn
{
    background: url(/images/leftBtn.png) 0 0 no-repeat;
    width: 56px;
    height: 56px;
    display: block;
    float: left;
    margin-top: 100px;
    cursor: pointer;
    margin-left: -60px;
}

#leftBtn:hover, #rightBtn:hover
{
    background-position: 0px -56px;
}

.definitionContent
{
    width: 820px;
    height: 365px;
    float: left;
}

但是,当我通过 Chrome 11 的开发人员工具栏检查 rightBtn 时,看看我发现了什么:

enter image description here

Chrome 解析器似乎将下一个选择器 (.definitionContent) 的 CSS 规则与我按钮的悬停规则混合在一起。有人知道吗?

最佳答案

您可以尝试更改 html( http://jsfiddle.net/PjFba/1/ ) 的顺序:

<div class="definitionContent">
    <div id="leftBtn"></div>

    <div id="rightBtn"></div>
</div>

关于css - Chrome 11 解析 CSS 规则的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6640835/

相关文章:

css - 在 Rails 3.1 中调用样式表

html - CSS 网格 - 最后一行元素太大

java - 无法使用相对 xpath 找到元素

html - CSS 自定义倒圆 Angular 梯形

javascript - 在另一个 CSSTransition 中嵌套 CSSTransitions?

CSS:可以做 position:fixed offset center div 吗?

java - Android 虚拟设备挂起的 Eclipse 调试器?

css - 有没有办法在 React Native 应用程序中调试 css?

c# - websocket 成功握手,但没有正确发送接收消息(C# 服务器)

google-chrome - 以编程方式将EnvironmentProperty设置为ChromeDriver