1

我尝试了以下方法:

<div data-role="header" data-position="fixed" data-tap-toggle="false">
<h1>My Page</h1>
<label for="nfcSwitch" class="ui-hidden-accessible">NFC:</label>
<input data-role="flipswitch" name="nfcSwitch" id="nfcSwitch" data-on-text="NFC on" data-off-text="NFC off" type="checkbox" />
</div>

但它在左侧显示了翻转开关,在h1

4

1 回答 1

1

HTML

<div data-role="header" data-position="fixed" data-tap-toggle="false">
    <h1>My Page</h1>
    <div class="switch">
        <label for="nfcSwitch" class="ui-hidden-accessible">NFC:</label>
        <input data-role="flipswitch" name="nfcSwitch" id="nfcSwitch" data-on-text="NFC on" data-off-text="NFC off" type="checkbox"/>
    </div>
</div>

CSS

.switch
{
    position: absolute;
    top: 0px;
    right: 0px;
}

JSFiddle

于 2014-07-29T06:45:57.743 回答