Is there any way to reference the system fonts and colors in Internet Explorer from HTML, CSS or MSHTML interfaces?

css, html, internet-explorer, mshtml

Solution

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:

    <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 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

Problem

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?

Original source