如何将 hr 分隔线居中(在 Bootstrap 4 中)

osk*_*333 1 frontend styling bootstrap-4

如何将 hr 分隔线居中?由于某种原因,尽管有文本中心引导类,它还是左对齐的。居中前后的文本!\n您可以在此处查看: http: //www.mokado.pl/index.html#about

\n\n
<section class="about page-section bg-primary" id="about">\n      <div class="container">\n        <div class="row justify-content-left">\n          <div class="text col-lg-4 text-center">\n            <h2 class="text-white mt-0">Mokado</h2>\n            <hr class="divider light my-4 text-center" />\n            <p class="text-white mb-4">\n              Ide\xc4\x85 marki Mokado jest po\xc5\x82\xc4\x85czenie estetyki i komfortu... \n            </p>\n            <!-- <a class="btn btn-light btn-xl js-scroll-trigger" href="#services"\n              >Get Started!</a\n            > -->\n          </div>\n        </div>\n      </div>\n    </section>\n
Run Code Online (Sandbox Code Playgroud)\n

Nis*_*hah 5

将此 CSS 添加到您的hr标签中

hr {
   margin: 0 auto;
}
Run Code Online (Sandbox Code Playgroud)

或者你也可以使用mx-auto类,如果你不想写CSS