Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Identify Microsoft Edge browser via CSS?

I'm developing web application and I need to identify Microsoft Edge's browser separately from others, to apply unique styling. Is there a way to identify Edge by using CSS? Just like,

<!--[if IE 11]>
Special instructions for IE 11 here
<![endif]-->
like image 542
Sameera Liyanage Avatar asked Aug 25 '15 10:08

Sameera Liyanage


People also ask

Can you identify the Microsoft Edge browser?

Here's how: Open the new Microsoft Edge , select Settings and more at the top of the window, and then select Settings . Scroll down and select About Microsoft Edge.

Does Microsoft Edge support CSS?

Beginning with EdgeHTML 15 in the Windows 10 Creators Update, Microsoft Edge introduces support for CSS Custom Properties, a new primitive value type to fully cascade variables across CSS properties. You can preview CSS Custom Properties in Windows Insider Preview builds beginning with EdgeHTML 15.15061.

How can I tell if Microsoft Edge is Chromium?

Checking if Edge is installed Open Start. Search for Microsoft Edge and click the top result. Quick tip: Microsoft Edge Chromium has a new blue and green icon with a wave shape. So, if you see a blue icon with a white "e," then you're likely using the old version.


4 Answers

/* 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

like image 183
KittMedia Avatar answered Sep 28 '22 16:09

KittMedia


/* 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/

like image 29
CodeGust Avatar answered Sep 28 '22 17:09

CodeGust


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).

like image 44
mature Avatar answered Sep 28 '22 18:09

mature


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);
         }
}
like image 33
Priya Nayak Avatar answered Sep 28 '22 16:09

Priya Nayak