Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to target Microsoft Edge with CSS? [duplicate]

I would like to target Edge and have flexbox behave simliar to Firefox 33 / Chrome, for more detail see this question.

Can one target Edge in CSS?

like image 671
maxhungry Avatar asked Oct 05 '15 03:10

maxhungry


People also ask

Does Microsoft Edge support CSS variables?

CSS Variables (Custom Properties) element is not supported by Microsoft Edge browser 12 to 14.

How do I enable CSS in Microsoft Edge?

First things first, make sure to update your Microsoft Edge to the latest version. Invoke the DevTools on the web page you want to have CSS Overview of. Either right-click on the web page and go to Inspect Element or use the combination Shift+Ctrl+J on Windows/Linux machines.


1 Answers

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.

like image 186
Raptor Avatar answered Sep 22 '22 13:09

Raptor