css - Bootstrap - 如何使面板内的字形居中?

标签 css twitter-bootstrap glyphicons

我正在尝试使用 Bootstrap 3 将一个字形图标置于面板的中央。就目前而言,该图标位于面板的左侧。

非常感谢任何建议。

我的代码:

<div class="panel-body">

      <span class="glyphicon glyphicon-asterisk" aria-hidden="true"></span>

最佳答案

您可以添加 Bootstrap 的 text-center给你的 div 类:

<div class="panel-body text-center">
      <span class="glyphicon glyphicon-asterisk" aria-hidden="true"></span>
</div>

bootply example

关于css - Bootstrap - 如何使面板内的字形居中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30400880/

相关文章:

javascript - Bootstrap Switch fn 不是函数

css - Bootstrap V2 中的 Bootstrap v3 图标

html - 无法使用align-self将 flex 元素居中

jquery - 当窗口调整大小时,Bootstrap 模态从左侧剪切

html - Bootstrap 4 表问题

javascript - 防止通过另一个元素的触发点击关闭导航栏

javascript - 在 JavaScript 中使用 Twitter Bootstrap 字形

twitter-bootstrap - Bootstrap 日历字形未正确显示

jQuery 变换旋转未按预期运行

jquery - 使用 jQuery freezeframe 创建可打印图像