如何使用引导程序将内容左右对齐?

时间:2015-04-28 17:26:54

标签: html css twitter-bootstrap-3

我正在努力实现与paypal.com网页类似的外观。我无法正确调整我的一些内容。我为每个部分都有一个封面bg,但我需要内容左右移动。

4 个答案:

答案 0 :(得分:4)

我不是100%理解你的问题,但是在paypal.com中对齐修改你的div如下

<div class="pull-right section col-md-6 light text-left">

添加&#34;右拉&#34;并使其成为&#34; text-left&#34;

希望这是有帮助的!

答案 1 :(得分:2)

在bootstrap中有一些特定的文本对齐类

.text-left{
 /* Text align left */
}
.text-right{
 /* Text align right*/
}
.text-center{
 /* Text align center*/
}
  

使用上述类,您可以对齐内容以及   布局中的内联元素。您还应该检查相同主题Dictionary

的bootstrap文档

答案 2 :(得分:2)

我不确定你想要实现的目标。你应该详细说明一点,以便我们可以提供帮助

.text-center, .text-right, .text-left, .pull-right, .pull-left 

是positon的bootstrap中的所有辅助方法,也可以使用网格

答案 3 :(得分:0)

注意:这在Bootstrap 3中已被删除。

Pre-Bootstrap 3,你可以使用像这样的CSS类分页:

 <div class="span12 pagination-centered">
 Centered content.
 </div>

以分页为中心的类已经在bootstrap.css(或bootstrap.min.css)中并且只有一条规则:

   .pagination-centered{text-align:center;}

使用Bootstrap 2.3.0。只需使用类文本中心