本文摘自PHP中文网,作者尚,侵删。

bootstrap中可以使用pull-right, pull-left、text-right, text-center, text-left来设置按钮的位置。
例:
以下是一段简单的示例,需要将其中每个li中的按钮靠右对齐:
1 2 3 4 | < ul >
< li >One < input class = "btn pull-right" value = "test" ></ li >
< li >Two < input class = "btn pull-right" value = "test2" ></ li >
</ ul >
|
方法一:
在Bootstrap 3中,可以使用pull-right样式类来将元素右对齐,如下:
1 2 3 4 5 | < ul >
< li >One < button class = "btn btn-primary pull-right" >test</ button ></ li >
< li >Two < button class = "btn btn-danger pull-right" >test2</ button ></ li >
</ ul >
|
适当调整一下每个li的高度,如下:
1 | li{line-height:40px; height:40px;}
|
方法二:
阅读剩余部分
相关阅读 >>
快速入门bootstrapvue
bootstrap有什么优势
bootstrap是css框架吗
浅谈bootstrap blazor组件的使用方法
bootstrap为什么弹出框没有内容
bootstrap是框架吗
bootstrap如何拖拽组件
bootstrap轮播图不用网可以吗
bootstrap主要是什么
bootstrap缓存怎么解决
更多相关阅读请进入《bootstrap》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » bootstrap中怎么设置按钮位置