【问题标题】:1px dotted border render in IE11/Edge在 IE11/Edge 中呈现 1px 虚线边框
【发布时间】:2016-10-07 06:34:40
【问题描述】:

注意到在 IE11/Edge 1px 虚线边框渲染中存在一些问题,在输入的某些部分它更亮,而在某些部分 - 更暗。

input {
  display: block;
  height: 23px;
  vertical-align: middle;
  font-size: 13px;
  margin: 0;
  min-width: 500px;
  padding: 0 10px;
  margin: 15px 0;
  color: #C2C2C2;
  background: #000000;
  border: 1px dotted black;
}

Image with 1px dotted border 即使我增加边框-> 2px,问题仍然存在。

Chrome/FF 看起来不错,这是解决这个问题的简单方法,而不是更改边框类型吗? https://jsfiddle.net/eehLaogk/11/(在IE11/Edge中打开)

【问题讨论】:

标签: css internet-explorer border microsoft-edge dotted-line


【解决方案1】:

这似乎是一个浏览器错误。我可以在IE11/Win7 上确认它会影响其他元素,而不仅仅是input 字段。

经过一些测试,我发现当元素的尺寸为偶数时会出现问题,例如500px 宽或40px 高。

使用像501px 宽和41px 高这样的奇数是一种临时解决方法:

body {
 background: #181818;
}

input {
    display: block;
    padding: 0 10px;
    height: 40px;
    margin: 15px 0;
    color: #C2C2C2;
    background: #000;
    border: 1px dotted #FFF;
    outline: none;
    width: 500px;
}

#input2 { width: 501px; height: 41px; }
<input id="input1" type="text" placeholder="500px wide (even)">
<input id="input2" type="text" placeholder="501px wide (odd)">

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2015-01-29
  • 2014-02-28
  • 1970-01-01
  • 2011-09-05
  • 2010-09-19
  • 2016-05-31
  • 2012-06-04
  • 1970-01-01
相关资源
最近更新 更多