我有一个 Bootstrap 设计的网站,我试图在每个页面的底部放置一个页脚,我有以下代码:
<div class ="container">
<div class="row">
<div class = "col-md-12" >
<footer style="text-align:center">Company. All Rights Reserved.</footer>
</div>
</div>
</div>
这并没有对齐文本中心,我需要做什么才能使文本位于视口(viewport)的中心?
最佳答案
在某些版本中:添加 center
在 <div class = "col-md-12 center" >
中上课
或
在某些版本中:添加 center-block
在 <div class = "col-md-12 center-block" >
中上课
和
对于文本居中对齐:添加text-center
在 <div class = "col-md-12 text-center" >
中上课
关于html - 在 bootstrap 'col-md-12' 中对齐文本中心,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45803442/