如何在 html/css 中访问 Windows 强调色

问题描述 投票:0回答:2

有没有办法让 Windows 强调色在 IE、Chrome、Moz 的 html/css 中使用?或者至少其中之一?

非常感谢您的帮助!

html css windows diacritics
2个回答
2
投票

您可以在 Firefox 上的 css 中使用

-moz-win-accentcolor
来执行此操作。

例如,如果您尝试使 div 的背景颜色与强调色相匹配,请执行以下操作:

div { 背景颜色:-moz-win-accentcolor; }

据我所知,没有其他浏览器(除了基于 Firefox 的浏览器)可以做到这一点。


0
投票

我知道这是一个老问题,但现在有系统颜色: https://developer.mozilla.org/en-US/docs/Web/CSS/system-color

请注意,Chrome 的 AccentColor/AccentColorText 可能会导致白底白字。

© www.soinside.com 2019 - 2024. All rights reserved.