【问题标题】:IE9 Border Color Bug?IE9边框颜色错误?
【发布时间】:2011-11-19 13:32:26
【问题描述】:

其他人能否查看此代码并确认这是 IE9 错误或告诉我我做错了什么?使用以下 HTML 代码。即使定义了红色的边框颜色,按钮的底部边框也会呈现与文本相同的颜色。 IE8 和地球上的所有其他浏览器都可以做到这一点。确保 IE9 以标准模式呈现。

<!DOCTYPE html>
<html>
<head>
<style type="text/css">
  button.button {
    color: blue;
    border: 0px;
    border-bottom: #FF0000 2px solid;
  }
</style>
</head>
<body>
  <button type="button" class="button">Update</button>
</body>
</html>

到目前为止,我发现的唯一解决方法是为样式底部的所有边重新声明边框颜色。

border-color: #FF0000;

【问题讨论】:

  • 很旧,但我可以确认我也看到了这种行为,正如你提到的,重新声明边框颜色似乎可以解决它。

标签: css html internet-explorer-9


【解决方案1】:

不知道它是否有助于检查它对我来说很好

使用这个

<!DOCTYPE html>
<html>
<head>
<style type="text/css">
button {
    border:0;
}

.update {
    color: blue;
    border-bottom: 2px #FF0000 solid;
    display: block;
    outline:none;
  }
</style>
</head>
<body>
   <button type="button" class="update">Update</button>
</body>
</html>

如果你接受我的意见,不要使用标签名作为类名

【讨论】:

  • 澄清一下:这是 IE9 中的一个错误。边框底部内边框颜色、边框宽度和边框样式的顺序无关紧要。
  • @Pumbaa80 同意。此外,这个更新的示例仍然没有为我解决问题。我仍然看到边框是蓝色的;
猜你喜欢
  • 2015-08-26
  • 2013-01-08
  • 1970-01-01
  • 1970-01-01
  • 2011-06-06
  • 2013-04-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多