Html 使水平单选按钮小部件具有固定宽度
我的页面中有一个水平单选按钮小部件,如下所示:Html 使水平单选按钮小部件具有固定宽度,html,jquery-mobile,Html,Jquery Mobile,我的页面中有一个水平单选按钮小部件,如下所示: <form> <fieldset data-role="controlgroup" data-type="horizontal" data-mini="true"> <input name="tool-selector" id="tool-selector-1" value="1" type="radio" checked> <label for="tool-selector-1">
<form>
<fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
<input name="tool-selector" id="tool-selector-1" value="1" type="radio" checked>
<label for="tool-selector-1">1</label>
<input name="tool-selector" id="tool-selector-2" value="2" type="radio">
<label for="tool-selector-2">2</label>
<input name="tool-selector" id="tool-selector-3" value="3" type="radio">
<label for="tool-selector-3">3</label>
<input name="tool-selector" id="tool-selector-4" value="4" type="radio">
<label for="tool-selector-4">4</label>
<input name="tool-selector" id="tool-selector-5" value="5" type="radio">
<label for="tool-selector-5">5</label>
<input name="tool-selector" id="tool-selector-6" value="6" type="radio">
<label for="tool-selector-6">6</label>
<input name="tool-selector" id="tool-selector-7" value="7" type="radio">
<label for="tool-selector-7">7</label>
</fieldset>
</form>
1.
2.
3.
4.
5.
6.
7.
我希望它总是跨过页面宽度,而不是在屏幕太宽时无法到达行尾,或者在屏幕太窄时溢出到下一行。这有可能吗?如果有,怎么做
谢谢。工作示例:
HTML:
这是jQuery Mobile,不是纯HTML解决方案
<form>
<fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
<input name="tool-selector" id="tool-selector-1" value="1" type="radio" checked>
<label for="tool-selector-1">1</label>
<input name="tool-selector" id="tool-selector-2" value="2" type="radio">
<label for="tool-selector-2">2</label>
<input name="tool-selector" id="tool-selector-3" value="3" type="radio">
<label for="tool-selector-3">3</label>
<input name="tool-selector" id="tool-selector-4" value="4" type="radio">
<label for="tool-selector-4">4</label>
<input name="tool-selector" id="tool-selector-5" value="5" type="radio">
<label for="tool-selector-5">5</label>
<input name="tool-selector" id="tool-selector-6" value="6" type="radio">
<label for="tool-selector-6">6</label>
<input name="tool-selector" id="tool-selector-7" value="7" type="radio">
<label for="tool-selector-7">7</label>
</fieldset>
</form>
.ui-controlgroup-controls {
width: 100% !important;
}
// This number shoud reflect 100 divided with number of controlgroup radio elements
.ui-controlgroup-controls .ui-radio {
width: 14.25% !important;
}
.ui-controlgroup-controls .ui-radio label {
text-align: center !important;
}