0

I'm newbie in Twitter bootstrap. how can I center a span in a parent row?

I'm using Twitter Bootstrap Version 2.3 and not 3.1 . Since in 3.1 there is a center-block that I cannot not use in 2.3. I have to use 2.3 so don't suggest me to upgrade.

Thanks alo

  • Check out this SO: http://stackoverflow.com/questions/19040301/center-bootstrap-row-and-spans Maybe this one is actually better: http://stackoverflow.com/questions/9382970/how-to-center-a-box-thing-with-bootstrap – JochemQuery Feb 04 '14 at 11:16

1 Answers1

1

Add class text-center to the span.

<div class="span12 text-center">some text</span>

Bootply

Alignment classes were released in bootstrap 2.3

Alternatively if you wanted to use your own css classes you could do this in a number of ways, one of them being like so:

Sample markup

<div class="row">
  <div class="span12 text-center">some text</div>
</div>

CSS

.row
{
   text-align: center;
}
.span12
{ 
  display: inline-block;
}
Danield
  • 121,619
  • 37
  • 226
  • 255