如何使用 CSS 定位 MicrosoftEdge?

我希望把 Edge 作为目标,并让 flexbox 的行为类似于 Firefox 33/Chrome、 更多细节请看这个问题

可以在 CSS 中定位 Edge 吗?

85015 次浏览

To target Edge (version < 79), we can check for -ms-ime-align support, Edge being the only Microsoft browser that supports this property:

@supports (-ms-ime-align: auto) {
.selector {
color: red;
}
}

Or this one-liner (that one works on Edge and all IEs also):

_:-ms-lang(x), .selector { color: red; }

Further explanation, including variants to support specific versions of Edge, can be found in this article.

For Edge version > 78, since its rendering engine (browser engine) changed to Blink, which is the Chrome's rendering engine, it should behave like Chrome.