如何通过 CSS 识别微软边缘浏览器?

我正在开发网络应用程序,我需要确定微软边缘的浏览器与其他分开,应用独特的样式。有没有办法通过 CSS 来识别 Edge? 就像,

<!--[if IE 11]>
Special instructions for IE 11 here
<![endif]-->
126242 次浏览

/* Microsoft Edge Browser 12-18 (All versions before Chromium) */

This one should work:

@supports (-ms-ime-align:auto) {
.selector {
property: value;
}
}

For more see: Browser Strangeness

/* Microsoft Edge Browser 12-18 (All versions before Chromium) - one-liner method */


_:-ms-lang(x), _:-webkit-full-screen, .selector { property:value; }

That works great!

// for instance:
_:-ms-lang(x), _:-webkit-full-screen, .headerClass
{
border: 1px solid brown;
}

https://jeffclayton.wordpress.com/2015/04/07/css-hacks-for-windows-10-and-spartan-browser-preview/

More accurate for Edge (do not include latest IE 15) is:

@supports (display:-ms-grid) { ... }

@supports (-ms-ime-align:auto) { ... } works for all Edge versions (currently up to IE15).

For Internet Explorer


@media all and (-ms-high-contrast: none) {
.banner-wrapper{
background: rgba(0, 0, 0, 0.16)
}
}


For Edge
@supports (-ms-ime-align:auto) {
.banner-wrapper{
background: rgba(0, 0, 0, 0.16);
}
}