1

フィールドセットを水平方向に中央揃えしようとしている非常に基本的なページを作成しました。中に入れようとしまし<centre>たが、うまくいきませんでした。私は何をすべきか?

これが私のコードです

<div data-role="content">   
    <div data-role="fieldcontain">
                //Its left align, how do i centre align
                <fieldset data-role="controlgroup" data-type="horizontal">
                        <input type="radio" name="radio-choice-b" id="radio-choice-c" value="on" checked="checked" />
                        <label for="radio-choice-c">Recent</label>
                        <input type="radio" name="radio-choice-b" id="radio-choice-d" value="off" />
                        <label for="radio-choice-d">Upcoming</label>
                </fieldset>
    </div>        
<ul data-role="listview">   
       //my list                       
    </ul>   
</div>
4

1 に答える 1

0

私にとってうまくいくことがわかったトリックは、フィールドセットを別の div にラップし、次の CSS をその div にインラインまたは CSS ファイルに配置することです。

display: table;
margin: 0 auto;

したがって、次のような結果になります

<div class='fieldset-center-wrapper'>
  <fieldset>
    your stuff here
  </fieldset>
</div>
于 2012-07-30T15:45:13.337 に答える