How can I expand or make the dojo button wider?

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;">&nbsp;</span></button></div>

I think it's clear what I'm trying to do. Do you know how I can make a button take 100% of the width of the container? Thanks.

+2
source share
3 answers

Ok, I got a response on the IBM forum, someone told me to override the style of the DJ:

.dijitButtonNode {width: 100%; }

and it did the job :-)

+1
source

if you need to change the width for a single instance, changing the CSS class would not be a good idea ... you can do it programmatically by applying a style to the domNode of your widget ... for example myButtom.domNode.style.width = "100%";

+1
source

if you stick to the declaration, add a qualifier class:

 <button data-dojo-type="dijit/form/Button" type="button" class="myButtons"></button> 

then in css:

 .myButtons .dijitButtonNode { width:100%; } 
+1
source

Source: https://habr.com/ru/post/893229/


All Articles