Bootstrap类"text-center"不起作用。
在Bootstrap 4.1.0中,我遇到了相同的问题。这是我找到的解决办法:
我之前这样写的(将段落放在带有"class"为"text-center"的div中):
<div class="container-fluid"> <div class="row" style="background-color: #009688;"> <p class="text-center" style="color: #fff;"> 在这里等我</p> </div> </div>
后来我去掉了"class",然后问题解决了。
<div class="container-fluid"> <div style="background-color: #009688;"> <p class="text-center" style="color: #fff;"> 在这里等我</p> </div> </div>
在Bootstrap 4.1版本中,我遇到了相同的问题,不得不移除了"row"类。