【问题标题】:Aligning two buttons to the center using bootstrap使用引导程序将两个按钮与中心对齐
【发布时间】:2021-09-02 01:41:11
【问题描述】:

我有下面的 div,希望两个按钮对齐到中心。 现在按钮向左对齐。我添加了“justify-content-center” 但仍然没有居中。我正在使用引导程序 5

    <div class="col-8 offset-2 col-lg-9 col-xl-6 offset-xl-3">
        <div class="row">
            <h1 class="mt-5">What is this all about. What is this all about. What is this all abour?</h1>
        </div>
        <div class="row mt-5 justify-content-center">
            <div class="col">
                <button type="button" class="btn btn-primary m-2">Yes Please</button>
                <button type="button" class="btn btn-primary">No Please</button>
            </div>
        </div>
    </div>

我做错了什么?

【问题讨论】:

    标签: bootstrap-4


    【解决方案1】:

    将“justify-content-center”替换为“text-center”。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-09-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多