css - 组合过滤器和 :hover in Chrome 时的奇怪行为

标签 css google-chrome

有人可以解释为什么会这样吗? 当我同时使用 transformfilter 时,overflow 属性将不起作用并出现 Angular 点。这是错误还是我遗漏了什么? 没有 filter 一切正常。在 Mozilla 中一切正常。

<div class="wrap">
    <div class="image"></div>
</div>

<style>
.wrap{
    width: 200px;
    height: 200px;
    overflow: hidden;
    border: 1px solid;
    border-radius: 15px;
}
.image{
    background: url(https://interactive-examples.mdn.mozilla.net/media/examples/grapefruit-slice-332-332.jpg);
    background-position: center;
    background-size: cover;
    width: 100%;
    height: 100%;
    transition: all 1s ease-out;
}
.image:hover{
    -webkit-transform: scale(1.2, 1.2);
    transform: scale(1.2, 1.2);
    -webkit-filter: saturate(1.7) brightness(1.05);
    filter: saturate(1.3) brightness(1.07);
}
</style>


https://jsfiddle.net/mith1408/nmvozkhd/2/

更新。 没有transform,只有filter,这个bug继续出现。 因此,问题不在于组合:transformfilter

UPD2. 看起来这是一个非常古老的错误,已修复但仅适用于被动元素。当您应用 :hover 时,错误会在过渡时刻再次出现。 Border radius and overflow hidden fail when CSS filter is applied in Chrome

来自旧主题的示例,修改为使用 :hover https://jsfiddle.net/mith1408/xk1hf3wq/3/

最佳答案

您的问题可能与堆栈上下文有关。两者 - 转换和过滤在应用时创建堆叠上下文。这是我的第一个想法。

您可以在这里阅读更多内容: MDN the stacking context

这里: stacking contexts: What they are and how they work

关于css - 组合过滤器和 :hover in Chrome 时的奇怪行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59086939/

相关文章:

css - 固定位置在不同的浏览器中不行,如何在Ext.Panel中制作一个带有列的表格?

google-chrome - 拒绝在我的 Chrome 扩展程序中加载很棒的字体资源

css - 设置机车引擎出了可怕的错误

html - bootstrap no-gutter 网格系统不工作

python - 在 Python 上使用 JSON 文件

google-chrome - SSL 证书;绿锁有时不显示

javascript - setAttribute iFrame 名称和 Chrome

android - 检查在自定义 chrome 选项卡中打开了哪个 url

html - 新网站宽度 >100%

html - 左对齐表单标签并隔开输入元素