Is there a way to refer to system fonts and colors in Internet Explorer from HTML, CSS, or MSHTML?

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 ​​that provide this functionality?

+4
source share
2 answers

Yes, you can reference system properties in your CSS. I know this works well with colors, not sure about fonts.

You just need to reference it like this:

  <style type="text/css"> body { font-family: InfoText; /* Tahoma, Segoe UI or MS Sans Serif */ color: ButtonText; background-color: ButtonFace; } </style> 

EDIT: With a little thought, I think this will work with fonts as well, but not with the way you referenced it with a dialog font . You simply refer to the system property, as well as to the other two, and the font defined for this property will be indicated on it.

Second EDIT: Here is a blog with a list of available properties, as well as more information than fonts:

How to use operating system styles in CSS

+7
source

CSS only affects part of the HTML view in the browser, not the system, so no.

Perhaps using any applet or activeX control will allow you to do this, but it is necessary.

0
source

Source: https://habr.com/ru/post/1299845/


All Articles