0

使用 jQuery mobile,我试图将一个开关和一个按钮放在同一行,但是它不起作用,两个元素都在不同的行中:

运行:http: //jsfiddle.net/cHqsJ/

代码:

<div data-role="fieldcontain">
    <label for="switch">Privacy:</label>
    <select name="switch" id="switch" data-role="slider">
        <option value="0">Private</option>
        <option value="1">Public</option>
    </select>
    <a href="#switchinfo" data-role="button" data-icon="info" data-iconpos="notext" data-rel="dialog">Switch Info</a>
</div>

我需要解决什么问题?

4

1 回答 1

1

使用Three-column grids. 演示http://jsfiddle.net/yeyene/Rdfxs/17/

        <div data-role="fieldcontain">
            <div class="ui-grid-b">
                <div class="ui-block-a"><label for="switch">Privacy:</label></div>
                <div class="ui-block-b">
                    <select name="switch" id="switch" data-role="slider">
                        <option value="0">Private</option>
                        <option value="1">Public</option>
                    </select>
                </div>
                <div class="ui-block-c">
                    <a href="#switchinfo" data-role="button" data-icon="info" data-iconpos="notext" data-rel="dialog">Switch Info</a>
                </div>
            </div><!-- /grid-b -->     
        </div>

*也有,data-inline="true"但标签会换行。

演示http://jsfiddle.net/yeyene/cHqsJ/1/

于 2013-07-04T02:36:36.820 回答