Jquery mobile jquery mobile:在选择按钮之前防止断线
在我的移动应用程序的页面标题中,我有:Jquery mobile jquery mobile:在选择按钮之前防止断线,jquery-mobile,Jquery Mobile,在我的移动应用程序的页面标题中,我有: <header data-role="header"> <h1>title</h1> <select name="select-choice-share" id="select-choice-share" class="shareitbutton" data-icon="myapp-shareicon" data-iconpos="notext" onchange="hand
<header data-role="header">
<h1>title</h1>
<select name="select-choice-share" id="select-choice-share" class="shareitbutton" data-icon="myapp-shareicon" data-iconpos="notext" onchange="handleSocialShare()">
<option value="facebook">Share on Facebook</option>
<option value="twitter">Tweet</option>
<option value="email">Email</option>
</select>
<a href="#creditspage" data-icon="info" data-iconpos="notext" class="ui-btn-right">Credits</a>
</header>
标题
在Facebook上分享
推特
电子邮件
但是选择按钮在下一行,而我希望它在同一行。
我试过几次,但都没成功。
你能帮我找到合适的CSS吗?
试试这个:
<select data-inline="true" name="select-choice-share" id="select-choice-share" class="ui-btn-left shareitbutton" data-icon="myapp-shareicon" data-iconpos="notext">
<option value="facebook">Share on Facebook</option>
<option value="twitter">Tweet</option>
<option value="email">Email</option>
</select>
演示。谢谢@kadaj,我使用了这个:
。共享它包装器{margin top:-3.4em;margin right:4em;float:right;}
但我不确定使用绝对定位是JQM的最佳选择……难道没有更干净的解决方案吗?谢谢你为什么用浮球?移动页面中的浮动似乎会产生更多问题。无论如何,我没有使用绝对定位。这是相对的。
.header {
padding: .5em;
}
.title {
font-weight: bold;
font-size: 16px;
padding: .5em;
}
.share-it-wrapper {
margin: -2.4em 0 0 3em;
}
<select data-inline="true" name="select-choice-share" id="select-choice-share" class="ui-btn-left shareitbutton" data-icon="myapp-shareicon" data-iconpos="notext">
<option value="facebook">Share on Facebook</option>
<option value="twitter">Tweet</option>
<option value="email">Email</option>
</select>
.ui-header .ui-select{
position: absolute;
top: .3125em;
}