dojo-添加了未正确设置样式的dom节点
我添加了以下内容作为dijit Select的标签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
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中,您似乎有类
;在CSS中,您选择类tj按钮标签
。这些需要匹配tjButtonLabel
- 您需要将标签的
样式设置为显示
,以便该元素有一个块用于应用宽度内联块
.tjButtonLabel{
width:120px;
background-color:#EEEFEF;
}