How do you get centered content using Twitter Bootstrap?

This is for Text Centering (which is what the question was about)

For other types of content, see Flavien's answer.

Update: Bootstrap 2.3.0+ Answer

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.


Original Answer (pre 2.3.0)

You need to define one of the two classes, row or span12 with a text-align: center. See http://jsfiddle.net/xKSUH/ or http://jsfiddle.net/xKSUH/1/


NOTE: this was removed in Bootstrap 3.


Pre-Bootstrap 3, you could use the CSS class pagination-centered like this:

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

Class pagination-centered is already in bootstrap.css (or bootstrap.min.css) and has the only one rule:

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

With Bootstrap 2.3.0. just use class text-center