我试图询问用户的生日,但遇到了一些文体问题。
你应该能从这个http://jsfiddle.net/DjsWv/14/中理解我的问题
我开始于:
<fieldset data-role="controlgroup" data-type="horizontal">
<legend>Date of Birth:</legend>
<select name="select-choice-month" id="select-choice-month" data-icon="false">
<option >Month</option>
<option value="jan">Jan</option>
</select>
<select name="select-choice-day" id="select-choice-day" data-icon="false">
<option >Day</option>
<option value="1">1</option>
</select>
<select name="select-choice-year" id="select-choice-year">
<option >Year</option>
<option value="2011">2012</option>
</select>
</fieldset>
这里的问题是我不喜欢宽度未满或 100%
我看到的唯一解决方案是使用导航栏,它看起来让我不舒服......关于如何让这个水平控制组显示为完整/标准宽度的任何想法
最佳答案
工作示例:http://jsfiddle.net/Gajotres/PUVkw/
HTML
<fieldset data-role="controlgroup" data-type="horizontal" class="custom-fieldset">
<legend>Date of Birth:</legend>
<select name="select-choice-month" id="select-choice-month" data-icon="false">
<option >Month</option>
<option value="jan">Jan</option>
</select>
<select name="select-choice-day" id="select-choice-day" data-icon="false">
<option >Day</option>
<option value="1">1</option>
</select>
<select name="select-choice-year" id="select-choice-year">
<option >Year</option>
<option value="2011">2012</option>
</select>
</fieldset>
CSS
.custom-fieldset .ui-controlgroup-controls {
width: 100% !important;
}
.custom-fieldset .ui-controlgroup-controls .ui-select {
width: 33.33% !important;
}
不要忘记将自定义类名添加到您的字段集中,在我的例子中它被称为:custom-fieldset
编辑
正在关注 ericjbasti 评论这是一个带有自定义 id 且没有 !important
的解决方案:http://jsfiddle.net/Gajotres/PUVkw/1/
关于jquery - 水平选择全宽 jQuery Mobile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17861017/