css - 在 twitter bootstrap 中以 span 为中心

标签 css twitter-bootstrap responsive-design css-frameworks

我是 Twitter bootstrap 的新手。如何在 parent row 中居中 span

我使用的是 Twitter Bootstrap 版本 2.3 而不是 3.1。因为在 3.1 中有一个中心 block ,我不能在 2.3 中不使用它。我必须使用 2.3,所以不要建议我升级。

谢谢

最佳答案

将类文本中心添加到跨度。

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

Bootply

Alignment classes在 bootstrap 2.3 中发布

或者,如果您想使用自己的 css 类,您可以通过多种方式实现,其中之一如下:

示例标记

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

CSS

.row
{
   text-align: center;
}
.span12
{ 
  display: inline-block;
}

关于css - 在 twitter bootstrap 中以 span 为中心,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21550891/

相关文章:

javascript - Fuelux - 如何使用中继器

html - 在移动其他 DIV 的位置之前将 DIV 的大小调整为最小值

javascript - 使用 AngularJS Bootstrap : ng-disabled is not noticable with btn-xs (or btn-sm)

css - 尽管在响应容器中,图像没有响应

html - 如何使另一个 div 中的 div 背景图像响应?

css - 设置宽度而不移动

css - 需要将 Pinterest 板向右浮动

CSS 边框 alpha 不起作用

html - 我想通过 bootstrap4 在不同的行中制作一个图标,文本

html - BootStrap navbar-brand 类中的 Logo 表现异常