For example, I see display:Inline-grid for chrome whereas display:-ms-inline-grid for IE. how do I need to change my CSS to work for both IE and Chrome?
Asked
Active
Viewed 181 times
0
-
Possible duplicate of [How to target only IE (any version) within a stylesheet?](https://stackoverflow.com/questions/28417056/how-to-target-only-ie-any-version-within-a-stylesheet) – לבני מלכה Mar 07 '19 at 07:33
-
Check this out : https://stackoverflow.com/a/13118250/10866402 – Harish Mar 07 '19 at 07:36
-
1If your question is simply if you can put both styles in the same stylesheet, the answer is yes, and put the unprefixed one last. `.grid {display: -ms-inline-grid; display: inline-grid;}` Is that what you want? – Mr Lister Mar 07 '19 at 07:39
1 Answers
1
You should place both items in the CSS file, like this:
.my-class {
display: -ms-inline-grid;
display: inline-grid;
}
Always place browser specific settings first, then the default. This way, if the browser supports the default setting, it will use it. Otherwise, it will pick up the browser specific setting, then ignore the unknown settings that come after it.

aridlehoover
- 3,139
- 1
- 26
- 24