【问题标题】:CSS rgba transparency bug in Chrome?Chrome中的CSS rgba透明度错误?
【发布时间】:2013-09-29 02:53:24
【问题描述】:

只需放置一个具有白色背景和任何不透明度值的 DIV:

background-color: rgba(255, 255, 255, .5);

在白色 (255x3) 背景上。实际上DIV的背景是254/254/254。这仅在 Chrome 中发生。 FF/IE/Opera/Safari 都可以。

错误?

【问题讨论】:

  • 我在 Chrome 中看不到 - 你有例子吗?
  • abc
    正如 Möhre 所说,您应该有良好的展示才能看到这一点。
  • 这是该错误的照片(Chrome 36):s13.postimg.org/ql29ma96f/white.png

标签: css google-chrome transparency rgba


【解决方案1】:

现在可以使用新的 will-change 属性来解决此问题。具体来说,will-change: transform;

【讨论】:

    【解决方案2】:

    奇怪的行为在 Chrome 38 和 Canary 40 中仍然存在。对我有用的解决方法是在具有 rgba 背景的 div 中添加 transform: translateZ(0);

    【讨论】:

      【解决方案3】:

      这看起来像一个错误!

      我可以确认这种不当行为。通过使用background: rgba(255,255,255,0.1) 也得到了它。更奇怪的是:计算出来的样式是background-color: rgba(255, 255, 255, 0.0980392)

      在使用 TN 技术的更便宜的显示器上很难看到,但仍然可以使用例如屏幕截图和测量。 Photoshop。

      这个问题类似于:
      webkit bug: input's background gets gray without any reason on focus?

      【讨论】:

        猜你喜欢
        • 2015-04-29
        • 2012-07-08
        • 2012-11-03
        • 2015-07-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-06-23
        • 2010-12-17
        相关资源
        最近更新 更多