单选按钮在jquery移动版1.0中心未正确对齐? [英] Radio button not align properly at center in jquery mobile version 1.0?

查看:66
本文介绍了单选按钮在jquery移动版1.0中心未正确对齐?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在jquery移动应用程序中使用了单选按钮,我使用的是jquery mobile 1.0和jquery 1.6.4。问题是它总是左对齐。所以,我试图在中心移动,但它不起作用。如何解决这个问题?提前致谢。

I used radio button in my jquery mobile application and i'm using jquery mobile 1.0 and jquery 1.6.4. The problem is it always aligned left. So, i tried to move at center but it is not working. How to fix this? Thanks in advance.

<div id="userOptionGroup" data-role="contain">
          <fieldset data-role="controlgroup" data-type="horizontal" data-theme="b" style="font-size:12px;border:2px;">
                <input type="radio" data-theme="b" name="radio-choice-b" id="radio-choice-wuser" value="windowUser"  checked="checked" />
                <label for="radio-choice-wuser" style="font-size: 12px;" class="ui-btn-section-active" id="lblWindowUser">win user</label>
                <input type="radio" data-theme="b" name="radio-choice-b" id="radio-choice-muser" value="mfileUser" />
                <label for="radio-choice-muser" style="font-size: 12px;" id="lblMfileUser">M file user</label>
          </fieldset>
          </div>


推荐答案

你必须在固定宽度的div中包装radiobuttons边距设置为字段集上的自动。这是怎么做的 - 当然不使用内联css更简洁。

You must wrap radiobuttons in a div with fixed width and margin set to auto on the fieldset. Here's how - of course it's neater to not use inline css.

<fieldset data-role="controlgroup" data-type="horizontal" style="text-align: center">
  <div style="width: 200px; margin: 0 auto;">
   <input type="radio" name="radio-choice-1" id="radio-choice-1" value="choice-1" checked="checked" />
   <label for="radio-choice-1">A</label>
   <input data-theme="e" type="radio" name="radio-choice-1" id="radio-choice-2" value="choice-2"  />
   <label for="radio-choice-2">B</label>
 </div>
</fieldset>

这篇关于单选按钮在jquery移动版1.0中心未正确对齐?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆