Bootstrap类"text-center"不起作用。

16 浏览
0 Comments

Bootstrap类"text-center"不起作用。

我试图将其居中显示,但没有成功。第二次尝试使用了相对位置,但在自适应设计中没有完全生效。

0
0 Comments

在Bootstrap 4中,想要实现居中对齐的效果,需要使用class= "mx-auto"。例如:<p class="mx-auto">Kailash</p> 这样的代码可以使文本在水平方向上居中对齐。

0
0 Comments

Bootstrap类"text-center"不起作用的原因可能是忘记在使用之前安装Bootstrap库。解决方法是确保在使用Bootstrap之前正确安装了该库。

0
0 Comments

在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"类。

0