4

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?

Daniel Rikowski
  • 71,375
  • 57
  • 251
  • 329

2 Answers2

7

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

jaywon
  • 8,164
  • 10
  • 39
  • 47
  • 1
    Wow. This is total news to me. Thanks! – Pekka Jan 30 '10 at 23:43
  • 2
    This is a great feature, but also opens countless new possibilities to shysters doing the old "Security scan. Your computer is infected. Click here to install anti-virus software" scam. Brrrr. – Pekka Jan 30 '10 at 23:45
  • I'm with Pekka, I thought the answer would be a complete 'no.' Thanks, and +1 =) – David Thomas Jan 31 '10 at 00:37
  • thanks guys, glad to help. yea good point Pekka, I never thought of that! – jaywon Jan 31 '10 at 01:49
0

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.

Ilian Iliev
  • 3,217
  • 4
  • 26
  • 51