gpt4 book ai didi

css - 在高对比度模式下 CSS 到底发生了什么?

转载 作者:技术小花猫 更新时间:2023-10-29 10:55:45 25 4
gpt4 key购买 nike

谁能解释一下 CSS 在高对比度模式下会发生什么?

http://hardlikesoftware.com/weblog/2009/11/04/css-sprites-vs-high-contrast-mode/

In high contrast mode all background images and colors are ignored — replaced with high contrast colors such as white on black or black on white. The other issue is that background images are not always printed.

还有比这更多的吗?

login form in high contrast mode

我的登录表单看起来不太理想,我正在尝试进行调查。

直到最近还有https://www.google.com/search?q=axs+aol+accesibility+library但它似乎不再存在。

通常我看到有两种方法:

  1. 检测 HCM(高对比度模式)并相应地调整 CSS
  2. 使 CSS 更加通用,使其适用于所有模式

无论哪种情况,我都非常想知道在 高对比度模式 中 CSS 发生了什么变化。

Google.com in various browsers

如您所见,行为各不相同,因此您的专业知识将受到赞赏。

最佳答案

@media screen and (-ms-high-contrast: active) {
/* put your styling rules here */
}

适用于 IE 和 MS Edge。在 Windows 10 中测试。

Chrome 不知道 Windows 10 是否处于高对比度模式。

关于css - 在高对比度模式下 CSS 到底发生了什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10091676/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com