dojo-添加了未正确设置样式的dom节点

dojo-添加了未正确设置样式的dom节点,dojo,Dojo,我添加了以下内容作为dijit Select的标签 domConstruct.create('label', {class:'tj-button-label', innerHTML:'Database', for:'db-select'},'place-here'); 像这样 <ContentPane> <label class='tj-button-label'>Label</label> <dijit

我添加了以下内容作为dijit Select的标签

domConstruct.create('label',  
   {class:'tj-button-label', innerHTML:'Database',  
    for:'db-select'},'place-here');  
像这样

<ContentPane>  
   <label class='tj-button-label'>Label</label>  
   <dijit Select>...</dijit Select>  
</ContentPane>  
节点被添加到dijit内容窗格中,就在Select之前。根据Firebug的说法,所有东西都放置正确,看起来很好。我可以轻松更改颜色、边距、填充和字体,但无法更改宽度

我做错了什么?

两个问题:

  • 在HTML中,您似乎有类
    tj按钮标签
    ;在CSS中,您选择类
    tjButtonLabel
    。这些需要匹配
  • 您需要将标签的
    显示
    样式设置为
    内联块
    ,以便该元素有一个块用于应用宽度
.tjButtonLabel{  
    width:120px;  
    background-color:#EEEFEF;  
 }