tags:

views:

375

answers:

3

I've got a very simple page, with one dijit button. I'm trying to override the font on the button with blue, times, bold. It works fine in FF, but in IE, I'm just seeing black, arial, normal text. If I look in IE Dev Toolbar, it shows the rule as applying, but not in the display. Am I doing something wrong? Here's the code:

<html>
    <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     <title>Theme Test</title>
     <link href="js/dojo/resources/dojo.css" rel="stylesheet" type="text/css">
     <link href="js/dijit/themes/tundra/tundra.css" rel="stylesheet" type="text/css">
     <style type="text/css">
      .tundra .dijitButton {
       font-family:'Times New Roman',Times,serif;
       color:#3a7bb8;
       font-weight:bold;
      }
     </style>
     <script type="text/javascript" src="js/dojo/dojo.js" djConfig="parseOnLoad:true, isDebug:false"></script>
     <script type="text/javascript">
      dojo.require("dijit.form.Button");
      dojo.require("dojo.parser");
     </script>
    </head>
    <body class="tundra">
     <button dojoType="dijit.form.Button">This should be Times, Bold, Blue</button>
    </body>
</html>
A: 

It's probably not ideal, but I can get this to work using an ID as opposed to the class. Maybe IE doesn't apply the style after the dijit is rendered? I dunno...here's the code I used:

<style type="text/css">
    #btn {
     font-family:'Times New Roman',Times,serif;
        color:#3a7bb8;
        font-weight:bold;
    }
</style>

<button dojoType="dijit.form.Button" id="btn">This should be Times, Bold, Blue</button>
Swingley
Hmm... that's certainly less than ideal. If I change the theme from tundra to nihilo, it changes the appearance, so *something's* getting applied. Just not my override.Maybe I can figure out some other more specific selectors to use, though. Or put the id on the outside somewhere....
sprugman
This didn't work: `<div id="btn"><button dojoType="etc">Should be Times</button></div>`
sprugman
+1  A: 

Try making the selector more specific, so you are assured it takes precedence, like:

body .tundra .dijitButton {}

Or, if IE has a weird bug about not properly cascading the style, choose the class that is applied on the precise area you want to modify, like:

body .tundra .dijitButtonText {}
jrburke
Thanks. I was hoping someone might know off-hand what cascade to use -- there are a **lot** of classes and spans in that generated code...
sprugman
+1  A: 

Using <button> as the selector seems to work:

<style>
button {
    font-family:'Times New Roman',Times,serif;
    color:#3a7bb8;
    font-weight:bold;
}
</style>

You can also use more specific selectors .tundra button, .tundra #myDiv button, etc.

sprugman
correct... IE6 has some issues with multiple CSS classes being used in selectors.
scunliffe