I'm using the jQuery UI Button control but don't seem to be able to adjust the size (width and height). Here's the API documentation. I tried setting a STYLE attribute on it, but then the LABEL wasn't centered correctly. Thanks.
Editing the size of a button in HTML is relatively easy. In the simplest form you just have to add a 'style' attribute to the button element containing your desired height and width values in pixels. It goes something like this. Alternatively, you can add a 'class' to button and add your styles in a CSS file.
HTML, CSS and JavaScript To set the button width, use the CSS width property.
button-small , and your HTML attribute class="button button-small" . .
Try this in the style attribute:
width: 300px; padding-top: 10px; padding-bottom: 10px;
or
$(element).css({ width: '300px', 'padding-top': '10px', 'padding-bottom': '10px' });
normally:
$(theElement).css('height','...px').css('width','...px');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With