-ms-high-contrast-adjust等效于IE9 [英] -ms-high-contrast-adjust equivalent in IE9

查看:822
本文介绍了-ms-high-contrast-adjust等效于IE9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的一个CSS文件使用 -ms-high-contrast-adjust:none 确保即使在高对比度模式下也会显示某些背景。它在IE10和IE11上正常工作。现在我们尝试将相同的CSS移植到IE9,显然它不被支持。什么相当于IE9下的-ms-high-contrast- * 属性,还是有其他方法诱使浏览器不能用高对比度模式设置更改?

解决方案

没有等效项。


strong>备注

在Windows 8中引入了-MS高对比度媒体功能。




<

 

code> @media屏幕和(-ms高对比度:活动){/ * ... * /}
@media屏幕和(-ms高对比度:黑白) {/ * * /}
@media screen和(-ms-high-contrast:white-on-black){/ * * /}

http: //msdn.microsoft.com/en-us/library/windows/apps/hh465764.aspx



一些开发人员使用它来定位IE10与媒体查询:

  @media屏幕和(-ms-高对比度:活动),(-ms-高对比度: {
/ * i-love-ie * /
}



PS,这是一种奇怪,你想要浏览器强制操作系统以特定的方式显示,或以特定的方式在操作系统上显示。



HOLD ON]



我只是从Steve Faulkner发现这篇文章: http://blog.paciellogroup.com/2010/01/high-contrast-proof-css-sprites/


使用before:伪元素的CSS sprites



使用traditonal
background-image方法实现CSS sprites是可用的,它解决了
图像不以高对比度模式显示的问题。这个替代的
方法使用CSS之前:伪元素(注意:后:
伪元素也可以使用)。示例:



与主页图标和默认显示颜色的文本链接。链接
a主页图标和窗口高对比颜色的文字。


CSS

  span.test1:before {
margin-right:-10px;
content:url(icons.png);
position:relative;
left:-2px;
top:-109px;
}

span.test1 {width:17px;
height:18px;
display:inline-block;
overflow:hidden;}

HTML


$ b b

 < a href =#>< span class =test1>< / span& 

我没有时间测试它。试试看,并回来给我们,所以我可以'正确'这个答案如果需要。


One of our CSS files use -ms-high-contrast-adjust: none to make sure some background show up even under high contrast mode. It works fine on IE10 and IE11. Now we try to port the same CSS to IE9 and obviously it's not supported. What's the equivalent of the -ms-high-contrast-* property under IE9, or is there some other way to trick the browser to not change with "high contrast mode" setting?

解决方案

There ain't an equivalent.

Remarks
The -ms-high-contrast media feature was introduced in Windows 8.

It's for ie10.

You can test it with media-queries like:

@media screen and (-ms-high-contrast: active) {/* ... */}
@media screen and (-ms-high-contrast: black-on-white) { /* */ }
@media screen and (-ms-high-contrast: white-on-black) { /* */ }

http://msdn.microsoft.com/en-us/library/windows/apps/hh465764.aspx

Some developers use it to target IE10 with media queries :

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
   /* i-love-ie */
}

PS, this is kind of freaky, you want a browser to force an OS to display in a specific way, or display in a specific way over the OS.

[HOLD ON]

i JUST found this article from Steve Faulkner : http://blog.paciellogroup.com/2010/01/high-contrast-proof-css-sprites/

CSS sprites using the before: pseudo element

An alternative to implementing CSS sprites using the traditonal background-image method is available and it resolves the issue of images not being displayed in high contrast mode. This alternative method makes use of the CSS before: pseudo element (note: the after: pseudo element could also be used). Example:

Link with a home icon and text with default display colors. Link with a home icon and text with windows high contrast colors.

CSS

span.test1:before {
margin-right: -10px;
content: url(icons.png);
position:relative;
left:-2px;
top:-109px;
}

span.test1 {width:17px;
height:18px;
display:inline-block;
overflow:hidden;}

HTML

<a href="#"><span class="test1"></span>Home</a>

I have no time to test it. Give it a try and come back to us so i can 'correct' this answer if needed.

这篇关于-ms-high-contrast-adjust等效于IE9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆