html - IE10+ 嵌套 3d 变换内部溢出 :auto are brake :hover behaviour

标签 html css internet-explorer transform

我在 IE 10-11 上使用 CSS 3d 转换时遇到问题
这是我简单化的 HTML 结构:

<ul>
    <li>Item 1</li>
    ...
    <li>Item 12</li>
</ul>

以及以下 CSS:

ul {  
    white-space: nowrap;
    overflow: auto;
    transform: rotateY(180deg);
}
li {
    display: inline-block;
    transform: rotateY(180deg);
}

这是一个JS Fiddle

问题是我无法在 IE 中使用 :hover 设置列表项的样式——它们几乎从不突出显示
如果我们将 overflow 设置为 hidden/visible,或者如果我们将删除任何 transform - 那么 :hover 就可以了。

此外,在其他浏览器中效果很好。
而且,这与 transform-style: preserve-3d

无关

什么可以解决这个问题?

最佳答案

很长一段时间后,我在我的上下文中找到了问题的解决方案。

问题是我们有另一种从右到左旋转元素的方法:

transform: scale(-1, 1);

并且这种方法使用 2d 转换而不是 3d。 这解决了 IE 中的问题。

JSFiddle - Fixed for IE

但如果您尝试在 Chrome 中打开 above fiddle (我使用的是版本 42 dev-m) - 您会看到错误呈现的滚动条。要修复它 - 只需将零翻译黑客添加到您旋转的所有元素(将此元素移动到单独的层上)

transform: scale(-1, 1) translate3d(0,0,0);

JSFiddle - Fixed for Chrome

但这又会在 IE 中返回问题! 所以我不得不在这里使用浏览器检测

P.S. But bug in IE rendering engine is still valid. This is just workaround for particular problem.

P.S.S. And also bug in Chrome rendering engine

关于html - IE10+ 嵌套 3d 变换内部溢出 :auto are brake :hover behaviour,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27171265/

相关文章:

css - 自定义 ionic 3 中的侧边菜单滚动条?

css - 保留一个 :after element on ellipsis

javascript - 使用 React 渲染的 IE 11 中未显示 Textarea 占位符

html - 显示无后占用空间

php - 无法按照我想要的方式对齐列表元素

html - ui 水平居中到左侧而不是中心的 anchor

css - css 中的 float 属性是否也需要 clear 属性?

css - 如何使登录表单响应

excel - 是否可以在 VBA 中创建和使用 Microsoft Edge 变量/对象?

css - DIV 颜色在 IE 中无法正确显示