我需要更改分组的单选按钮的宽度,但我不能这样做。我尝试添加style=width:...px,但它不起作用。
我使用的是jQuery手机和科尔多瓦。
我怎么才能修复它?
HTML
<div data-role="fieldcontain" data-inline="true">
<fieldset data-role="controlgroup" data-inline="true">
<legend>Question1:</legend>
<input type="radio" name="radio-choice" id="radio-choice-1" value="choice-1"/>
<label for="radio-choice-1">OK</label>
<input type="radio" name="radio-choice" id="radio-choice-2" value="choice-2"/>
<label for="radio-choice-2">KO</label>
<input type="radio" name="radio-choice" id="radio-choice-3" value="choice-3"/>
<label for="radio-choice-3">N.A.</label>
<input type="text" name="name" id="basic" value=""/>
</fieldset>
</div>发布于 2012-09-05 16:33:40
尝试对<label>元素应用width样式:
<div data-role="fieldcontain" data-inline="true">
<fieldset data-role="controlgroup" data-inline="true">
<legend>Question1:</legend>
<input type="radio" name="radio-choice" id="radio-choice-1" value="choice-1"/>
<label for="radio-choice-1" style="width: 100px;">OK</label>
<input type="radio" name="radio-choice" id="radio-choice-2" value="choice-2"/>
<label for="radio-choice-2" style="width: 100px;">KO</label>
<input type="radio" name="radio-choice" id="radio-choice-3" value="choice-3"/>
<label for="radio-choice-3" style="width: 100px;">N.A.</label>
<input type="text" name="name" id="basic" value=""/>
</fieldset>
</div>您可以在this fiddle中查看结果。
请注意,如果您希望所有标签都具有相同的宽度,请创建一个CSS规则,将该宽度分配给一个类,然后将该类添加到您的标签中,这将减少代码重复。
https://stackoverflow.com/questions/12276592
复制相似问题