html - 如何将按钮放在中间

标签 html css jquery-mobile

我正在使用 jQuery Mobile 创建我的移动应用程序。我有一个加号按钮,如下所示:

enter image description here

问题是它向下,触及列表项。如何使按钮位于列表项和它上方的水平线之间的中间位置?我尝试使用 css 使用绝对定位,但没有用。

这是我的代码:

<span style="float:left;color:black;font-weight:bold;font-size:24px"><label for="newpostbutton">Posts</label></span>
<span style="float:right;"><a href="#" data-role="button" id="newpostbutton" data-icon="plus" data-iconpos="notext"></a></span>
<br>
<ul data-role="listview" data-inset="true" id="threads">
    <li>No conversations :(</li>
</ul>

任何帮助将不胜感激:D

最佳答案

nshah,你总是可以给你的按钮一个负边距顶部并玩弄数字。但看起来默认按钮样式可能还有更多内容。我会先看看那里。

margin-top: -15px;

关于html - 如何将按钮放在中间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22337940/

相关文章:

html - Webkit 中的裁剪滚动条和边框

javascript - 滚动问题后的 prestashop 固定菜单

css - 如何使用 CSS 制作这种响应式布局?

jquery - $.mobile.activePage 属性到底是如何工作的?

android - 存储 WebView 以供离线浏览

html - 级联 html 表中的边框

php - 如何从 ajax.done() 获取数据?

html - 如何使用媒体查询使我的列堆叠在一起

Android Phonegap Compilations 在应用程序底部添加了不应该存在的栏?

jquery-mobile - jQuery Mobile 对话框和 Backbone js