有没有办法从 HTML、CSS 或 MSHTML 界面引用 Internet Explorer 中的系统字体和颜色?
我想做这样的事情:
<style type="text/css">
body {
font-family: dialog-font; /* Tahoma, Segoe UI or MS Sans Serif */
color: button-text;
background-color: button-face;
}
</style>
是否有任何 Microsoft 特定的 CSS 值提供此功能?
I want to do something like this:
<style type="text/css">
body {
font-family: dialog-font; /* Tahoma, Segoe UI or MS Sans Serif */
color: button-text;
background-color: button-face;
}
</style>
Are there any Microsoft-specific CSS values which provide this functionality?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,您可以在 CSS 中引用系统属性。我知道这对颜色很有效,但不确定字体。
只需要像这样引用:
编辑:再想一想,我认为这也适用于字体,但不是你用 dialog-font 引用它的方式。您只需引用系统属性,与其他两个属性相同,并且将引用为该属性定义的字体。
第二次编辑:这是一个博客,其中包含可用属性列表,以及比我有关字体的更多信息:
如何在 CSS 中使用操作系统样式
Yes, you can reference the system properties in your CSS. I know this works well with colors, not sure about fonts.
Just need to reference like this:
EDIT: With a little more thought, I think this will work with fonts as well, but not how you were referencing it with dialog-font. You would just reference the system property, same as the other two, and the font defined for that property will be referenced.
Second EDIT: Here is a blog with the list of available properties, as well as more info than I had on fonts:
How to Use Operating System Styles in CSS
CSS 只影响浏览器的 HTML 表示部分,而不影响系统部分,所以不。
也许使用某种小程序或 ActiveX 控件可以让您做到这一点,但这有必要吗?
CSS affects only the HTML representation part of the browser and not the system one, so NO.
Maybe using some kind of applet or activeX control will allow you to do this, but is this necessary.