Bootstrap: center any span

You can center it with:

.center {
   margin: 0 auto !important;
   float: none !important;
}

JSFiddle

Or you can use:

.row-fluid [class*="span"].center, .center {
    margin: 0 auto;
    float: none;
}

I tend to avoid !important because you never know when it may differ with some other CSS. Interestingly, the above affect differs on both .row and .row-fluid.


As of Bootstrap 2.3.0 you can use the built in class .text-center.

<div class="row-fluid">

    <div class="span12 text-center">

    My content to be centered here

    </div>

</div>

It worked perfectly for me... :)