【发布时间】:2023-03-15 06:38:02
【问题描述】:
我想以 Edge 为目标并使 flexbox 的行为类似于 Firefox 33 / Chrome,for more detail see this question。
可以在 CSS 中以 Edge 为目标吗?
【问题讨论】:
标签: css browser-detection microsoft-edge
我想以 Edge 为目标并使 flexbox 的行为类似于 Firefox 33 / Chrome,for more detail see this question。
可以在 CSS 中以 Edge 为目标吗?
【问题讨论】:
标签: css browser-detection microsoft-edge
要定位Edge (version < 79),我们可以检查-ms-ime-align 支持,Edge 是唯一支持此属性的 Microsoft 浏览器:
@supports (-ms-ime-align: auto) {
.selector {
color: red;
}
}
或者这个单行(也适用于 Edge 和所有 IE):
_:-ms-lang(x), .selector { color: red; }
更多解释,包括支持特定版本 Edge 的变体,可以在 this article 中找到。
对于 Edge 版本 > 78,由于其渲染引擎(浏览器引擎)更改为 Blink,这是 Chrome 的渲染引擎,它的行为应该与 Chrome 类似。
【讨论】:
.tb-product-loop-wrap.grid-view.shop-columns-3 ul.products li.product { width: 30%; }