views:

63

answers:

2

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?

A: 

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
I don't want to *affect* the system colors, just use them.
DR
My mistake, I understand it as you want to affect the font colors for dialog boxes, browser menus etc.If you want to affect the html part than jaywon is right.
Ilian Iliev
+7  A: 

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
Wow. This is total news to me. Thanks!
Pekka
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
I'm with Pekka, I thought the answer would be a complete 'no.' Thanks, and +1 =)
David Thomas
thanks guys, glad to help. yea good point Pekka, I never thought of that!
jaywon