JonSnow
JonSnow

Reputation: 335

CSS: How to detect the OLD Edge BUT NOT THE NEW Edge Chromium?

Is there a way to handle the old Edge seperatly from the new Edge Chromium in CSS?

For the pre-Chromium versions I've used the following snippet so far:

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

Now I need to make sure that this affects only the OLD Edge and that the new Chromium based Edge will ignore these lines.

Can someone confirm this? I havent't found any information on this topic so far and I don't have the new Edge in the office (and the page I am going to build these days is behind a firewall)

Upvotes: 0

Views: 615

Answers (1)

Yu Zhou
Yu Zhou

Reputation: 12999

The new Edge is Chromium-based so it's like Chrome. You can still use that CSS rule to target Edge Legacy and it won't affect Edge Chromium.

I made a simple sample like this:

@supports (-ms-ime-align:auto) {
  #aaa {
    background-color: yellow
  }
}
<div style="width:200px; height:200px" id="aaa">
  aaa
</div>

The result in Edge Chromium is like this:

enter image description here

Upvotes: 2

Related Questions