naveen naveen - 3 months ago 17
CSS Question

What is this css rule -ms-high-contrast-adjust?

While viewing Facebook source, I came across this property. Google yeilded no results.

i.img {
-ms-high-contrast-adjust: none;
_overflow: hidden;
}


Apparently, chrome inspector doesn't recognize it.

Chrome Inspector

Answer

Docs for -ms-high-contrast-adjust can be found here: https://msdn.microsoft.com/en-us/library/hh771863(v=vs.85).aspx

Gets or sets a value that indicates whether to override any Cascading Style Sheets (CSS) properties that would have been set in high contrast mode.

auto Indicates the applicable CSS properties will be adjusted as expected when the system is in high contrast mode.

none Indicates the applicable CSS properties will not be adjusted when the system is in high contrast mode.

More info on the underscore prefix can be found in this post: Does the minus sign or underscore in css do anything?

And this wiki article: https://en.wikipedia.org/wiki/CSS_filter#Underscore_hack

Versions 6 and below of Internet Explorer recognized properties with this prefix (after discarding the prefix). All other browsers ignore such properties as invalid. Therefore, a property that is preceded by an underscore or a hyphen was applied exclusively in Internet Explorer 6 and below.

Edit: When using a search engine, wrap your CSS rule in quotes to have the results you want pop up. For example: https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=css+%22-ms-high-contrast-adjust%22

Comments