如何使用Twitter引导获取居中的内容? [英] How do you get centered content using Twitter bootstrap?

查看:289
本文介绍了如何使用Twitter引导获取居中的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想跟着一个非常基本的例子。使用起始页和网格系统,我希望看到以下内容:

I'm trying to follow a very basic example. Using the starter page and the grid system, I was hoping the following:

<div class="row">
  <div class="span12">
    <h1>Bootstrap starter template</h1>
    <p>Example text.</p>
  </div>
</div>

...将产生中心文本。

...would produce centered text.

但是,它仍然出现在最左边。

However, it still appears on the far left. What am I doing wrong?

推荐答案

这是为文本居中(这是什么问题



有关其他类型的内容,请参阅 Flavien的回答

更新:Bootstrap 2.3.0+回答

Update: Bootstrap 2.3.0+ Answer

.text-center

The original answer was for an early version of bootstrap. As of bootstrap 2.3.0, you can simply give the div the class .text-center.

原始答案(pre 2.3.0)

两个类之一, row span12 text-align:center 。请参见 http://jsfiddle.net/xKSUH/ http://jsfiddle.net/xKSUH/1/

这篇关于如何使用Twitter引导获取居中的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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