【问题标题】:How do you center form controls with Bootstrap?您如何使用 Bootstrap 将表单控件居中?
【发布时间】:2013-01-24 15:42:38
【问题描述】:

我不知道如何在 Bootstrap 中将表单控件居中。我尝试将所有内容都包装在 .center div 中,但这会将某些内容居中并搞砸其他内容。

.center
{
  text-align: center;
}

【问题讨论】:

  • 谷歌是你最好的朋友:stackoverflow.com/questions/10352866/…
  • @goodmanship 我试过了。但具体来说,我需要的是两个单选按钮,居中和内联。而且我似乎无法理解。
  • 支持兄弟。我想你的意思是@david ^
  • 尝试向我们提供您正在使用的 HTML,我们将能够提供更好的帮助。
  • 我找到了 simple_form 并正在尝试以下方法:

标签: css twitter-bootstrap


【解决方案1】:

你可以使用文本中心类

<p class="text-center">Center aligned text.</p>

其他文本对齐类是

<p class="text-left">Left aligned text.</p>
<p class="text-center">Center aligned text.</p>
<p class="text-right">Right aligned text.</p>
<p class="text-justify">Justified text.</p>
<p class="text-nowrap">No wrap text.</p>

详情请访问http://getbootstrap.com/css/

【讨论】:

    猜你喜欢
    • 2012-03-17
    • 2016-12-14
    • 2015-09-24
    • 1970-01-01
    • 1970-01-01
    • 2018-11-21
    • 2021-09-06
    • 2020-05-18
    • 2021-09-04
    相关资源
    最近更新 更多