applying css to dijit button

守給你的承諾、 提交于 2019-12-05 06:46:36

see above :-) Surround with a DIV and use that DIV in your static CSS.

I think decorating with HTML may actually be a simpler solution than trying to bake more into the widget or the widget's template.

Instead of applying the style by ID, do it through a class.

Stylesheet:

.myBtn { margin-left: 100px; }

Code:

<button class="myBtn" dojoType="dijit.form.Button" id="myBtn">Testing</button>

http://jsbin.com/ejoma/2

In this case you should not add the margin-left to the button itselft but to the additional HTML araound the button that is created. Try this:

.dijitLeft{
    margin-left: 100px;
}

But this will indeed add a margin to every button. If you don't want that, add the margin to the parent span using JavaScript after the additional HTML was created.

Inline style is working.

<button id="myBtn" dojoType="dijit.form.Button" style="margin-left:100px">Testing</button>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!