单选按钮在jquery移动版1.0中心未正确对齐?

sel*_*rai 6 jquery html5 jquery-ui radio-button jquery-mobile

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

<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>
Run Code Online (Sandbox Code Playgroud)

Ham*_*olf 8

您必须在一个div中包装radiobutton,并在字段集上将固定宽度和边距设置为auto.这是怎么做的 - 当然不使用内联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>
Run Code Online (Sandbox Code Playgroud)