【问题标题】:Renderin-Bug in Webkit with background-color and border-radius带有背景颜色和边框半径的 Webkit 中的渲染错误
【发布时间】:2014-06-03 09:58:36
【问题描述】:

如果我使用浮动块元素作为图像的容器并且图像具有一定的边框半径,则所有 webkit 浏览器在渲染容器元素的背景颜色时都会出现问题。在 IE 11 和最新的 firefox 中一切正常!

这里以小提琴为例:http://jsfiddle.net/5wZeG/2/

CSS:

.galerie-image {
    background: #00DDDD;
    border-radius: 10px;
    height: 200px;
    width: 200px;
    display: block;
    float: left;
}
.galerie-image img {
    border: 0;
    border-radius: 50% 10px;
    height: auto;
    margin-bottom: -4px;
    width: 100%;
}

HTML:

<a class="galerie-image" target="_blank" title="The Quadrat" href="http://google.com">
    <img alt="Quadrat" title="The Quadrat" src="http://dummyimage.com/400x400/000/fff&text=Placeholder" />
</a>

还有一张图片:FF vs chrome:

这是一个错误还是有一个简单的解决方案? (提前谢谢!)

【问题讨论】:

    标签: google-chrome webkit background-color css


    【解决方案1】:

    这也可能是 opera 上出现的渲染错误,临时修复可以将图像的宽度设置为 width: 99.99999%;

    .galerie-image img {
    border: 0;
    border-radius: 50% 10px;
    height: auto;
    margin-bottom: -4px;
    width: 99.99999%;
    }
    

    【讨论】:

    • 谢谢!有用!新的 Opera 也使用了 webkit。所以我认为这是一个webkit问题。不错的解决方案!
    猜你喜欢
    • 1970-01-01
    • 2017-09-19
    • 2011-09-12
    • 1970-01-01
    • 2022-01-03
    • 1970-01-01
    • 1970-01-01
    • 2013-03-09
    • 2012-02-28
    相关资源
    最近更新 更多