html - Chrome 在设置了边框半径的高大对象左侧使用了错误的边框颜色

标签 html css google-chrome colors

我相信 chrome 的边框颜色渲染可能存在错误。这是设置:

  1. 创建一个元素(我在 div 和 td 上都看到过它,包括 position:static 和 position:absolute)。
  2. 让这个物体的高度是它宽度的两倍以上
  3. 为每一侧分配不同颜色的边框。
  4. 指定圆 Angular 的 border-radius。

最终结果是左边缘的中间部分采用 border-right-color 而不是 border-left-color。具体来说,如果 w 是对象的宽度,则顶部 w 个像素和底部 w 个像素是正确的,但中间 (h - 2w) 个像素的颜色不正确。

这是演示该问题的代码片段和屏幕截图。

<!doctype html>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<html>
  <head>
    <style>
      div#borderBug
      {
        position:absolute;
        top:10px;
        left:10px;
        width:152px;
        height:541px;
      
        border-width: 2px;
        border-style: solid;
        border-radius: 20px;
      
        border-left-color: blue;
        border-top-color: yellow;
        border-right-color: red;
        border-bottom-color: green;

        background-color: #dedede;
      }
    </style>
  </head>
  <body>
    <div id="borderBug"></div>
  </body>
</html>

Incorrect Left Border in Chrome

我的 Chrome 版本是 17.0.963.56 m,在 Windows XP 上运行。我在 Safari、Firefox 或 IE8 中没有看到该问题。

任何人都可以确认这是否是一个已知问题,或者是否有人知道标准的解决方法?

我能想到的最好的解决方法是使用图像作为边框,但我还没有能够对此进行测试并查看它是否遇到相同的错误。

另一个(丑陋的)选项可能是将另一个正确颜色的 HTML 元素放在有问题的边框部分的顶部。

最佳答案

已确认的已知问题:

Issue 106028
合并到Issue 113726

关于html - Chrome 在设置了边框半径的高大对象左侧使用了错误的边框颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9490027/

相关文章:

google-chrome - Chrome 位置 :fixed and transformZ bug

html - 溢出-x :hidden; in Chrome & Firefox 的问题

asp.net - 无法更改 div 的高度。

javascript - 选择新元素时如何更改事件的 <li> 元素?

javascript - javascript 中的 html 输入值

css - Firefox 滚动条但在 Chrome 上没有

jquery - 在我的脚本中出现一些未知错误

javascript - 如何使querySelectorAll仅从当前元素的子元素中选择

html - 如何防止打印::在 css 之后?

css - PhpStorm + 实时编辑,看不到对附加的 css 文件所做的更改