我如何扩展或使 dojo 按钮更宽?
我有这段代码:
<按钮 dojoType="dijit.form.Button" style="width:100%;" doLayout="true">
我想我很清楚我的意思尝试去做。 你知道如何让按钮占据容器宽度的 100% 吗? 谢谢。
I have this piece of code:
<div dojoType="dijit.layout.ContentPane" style="width:200px;margin:0;padding:0;" doLayout="true"> <button dojoType="dijit.form.Button" style="width:100%;" doLayout="true"><span style="width:200px;"> </span></button></div>
I think it is clear what I try to do.
Do you know how I could make the button take 100% of it's container's width?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好吧,
我在IBM的论坛上得到了答案,有人告诉我重写dijit样式:
.dijitButtonNode{
宽度:100%;
这就
完成了工作
:-)
Alright,
I got the answer at an IBM's forum, someone told me to override the dijit style:
.dijitButtonNode{
width:100%;
}
and that did the job
:-)
如果您需要更改单个实例的宽度,则更改 CSS 类并不是一个好主意...您可以通过将样式应用到小部件的 domNode 以编程方式实现...如
myButtom。 domNode.style.width = "100%";
if you need to change the width for a single instance, changing the CSS class wouldn't be a good idea... you can make it programmatically by applying the style to the domNode of your widget... like
myButtom.domNode.style.width = "100%";
如果坚持声明,请添加一个说明符类:
然后,在 css 中:
if sticking with declaration, add a specifier class:
then, in css: