如何使我的Twitter Bootstrap按钮正确对齐? [英] How can I get my Twitter Bootstrap buttons to right align?

查看:93
本文介绍了如何使我的Twitter Bootstrap按钮正确对齐?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a simple demo here:

http://jsfiddle.net/HdeZ3/1/

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

我有一个无序列表,我希望每个列表项的左边都有文本,然后有一个右对齐的按钮.我尝试使用向右拉,但这完全弄乱了对齐方式.我在做什么错了?

I have an unordered list and for each list item I wish to have text on the left and then a right aligned button. I have tried to use pull-right but this completely messes up the alignment. What am I doing wrong?

推荐答案

pull-right插入到class属性中,并让引导程序安排按钮.

Insert pull-right into the class attribute and let bootstrap arrange the buttons.

有关 Bootstrap 2.3 ,请参阅: http://getbootstrap .com/2.3.2/components.html#misc >助手类> .pull-right.

For Bootstrap 2.3, see: http://getbootstrap.com/2.3.2/components.html#misc > Helper classes > .pull-right.

有关 Bootstrap 3 ,请参见: https://getbootstrap.com/docs/3.3/css/#helper-classes >助手类.

For Bootstrap 3, see: https://getbootstrap.com/docs/3.3/css/#helper-classes > Helper classes.

有关 Bootstrap 4 ,请参见: https://getbootstrap.com/docs/4.0/utilities/float/#sensitive

pull-right命令已被删除,并替换为float-right或通常替换为float-{sm,md,lg,xl}-{left,right,none}

The pull-right command was removed and replaced with float-right or in general to float-{sm,md,lg,xl}-{left,right,none}

这篇关于如何使我的Twitter Bootstrap按钮正确对齐?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆