我正在尝试使用 jQuery Mobile 演示页面中的 html 并排创建两个水平单选按钮组。
问题是当单选按钮之间仍有足够的空间时,单选按钮会断开并开始换行到下一行。有没有一种方法可以将它们设置为不换行,直到在小屏幕上两者之间几乎没有空间?
您可以在 this fiddle. 中看到发生了什么
此外,我想将第二个 radio 分组向右对齐,但添加 text-align:right
或 position:relative; right:0px
到 #SecondGroup 没有任何效果。
这是我的代码:
<div data-role="fieldcontain">
<fieldset class="ui-grid-a ">
<div class="ui-block-a" id="FirstGroup">
<fieldset data-role="controlgroup" data-mini="true" data-theme="b" data-type="horizontal" >
<input type="radio" name="same" id="sold" value="on" checked="checked">
<label for="sold">One</label>
<input type="radio" name="same" id="active" value="off">
<label for="active">Two</label>
</fieldset>
</div>
<div class="ui-block-b" id="SecondGroup">
<fieldset data-role="controlgroup" data-mini="true" data-theme="b" data-type="horizontal" >
<input type="radio" name="conditionSame" id="all" value="on" checked="checked">
<label for="all">One</label>
<input type="radio" name="conditionSame" id="used" value="on" >
<label for="used">Two</label>
<input type="radio" name="conditionSame" id="new" value="on">
<label for="new">Three</label>
</fieldset>
</div>
</fieldset>
</div>
谢谢。
最佳答案
您的代码中有不可见的空格
(请参见下面的屏幕截图)。移除它们后,包装工作。
fiddle :http://jsfiddle.net/bunoxL4r/3/
在这张 fiddle 源代码的屏幕截图中,您可以看到这些
:
关于jquery - 阻止 jQuery Mobile 水平单选按钮断开或环绕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28930974/