请考虑这里的这段代码,也给出了这个 fiddle :http://jsfiddle.net/DPNc6/
HTML:
<div style="width:500px" id="radio">
<input type="radio" id="radio1" name="radio" /><label for="radio1">Choice 1</label>
<input type="radio" id="radio2" name="radio" checked="checked" /><label for="radio2">Choice 2</label>
<input type="radio" id="radio3" name="radio" /><label for="radio3">Choice 3</label>
</div>
JS;
$('#radio').buttonset()
如您所见,我试图让整个按钮集填充宽度为 500px,但使用此样式属性似乎没有任何作用。如何将整个按钮集的宽度设置为一定数量的像素?
谢谢!
最佳答案
我相信适用于可变数量按钮的最佳跨浏览器兼容解决方案是将其包装在表格中:http://jsfiddle.net/DPNc6/1/
关于javascript - 如何设置整个按钮组的宽度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12306242/