如何使 Twitter Bootstrap 按钮右对齐?

2024-01-25

我这里有一个简单的演示:

<ul>
    <li>One <input class="btn pull-right" value="test"></li>
    <li>Two <input class="btn pull-right" value="test2"></li>
</ul>

我有一个无序列表,对于每个列表项,我希望左侧有文本,然后有一个右对齐按钮。我尝试过使用向右拉,但这完全扰乱了对齐方式。我究竟做错了什么?

<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet" />
<ul>
  <li>One <input class="btn pull-right" value="test"></li>
  <li>Two <input class="btn  pull-right" value="test2" </li>
</ul>

Insert pull-right进入类属性并让引导程序排列按钮。

For 引导程序2.3, see: http://getbootstrap.com/2.3.2/components.html#misc http://getbootstrap.com/2.3.2/components.html#misc> 辅助类 > .pull-right。


For 引导程序3, see: https://getbootstrap.com/docs/3.3/css/#helper-classes https://getbootstrap.com/docs/3.3/css/#helper-classes> 助手类。


For 引导程序4, see: https://getbootstrap.com/docs/4.0/utilities/float/#responsive https://getbootstrap.com/docs/4.0/utilities/float/#responsive

The pull-right命令被删除并替换为float-right或者一般来说float-{sm,md,lg,xl}-{left,right,none}


For 引导程序5, see: https://getbootstrap.com/docs/5.0/utilities/float/ https://getbootstrap.com/docs/5.0/utilities/float/

最接近的解决方案是float-end.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何使 Twitter Bootstrap 按钮右对齐? 的相关文章

随机推荐