gpt4 book ai didi

html - 在 Div 中居中文本 : Bootstrap

转载 作者:行者123 更新时间:2023-11-28 11:59:26 27 4
gpt4 key购买 nike

我试图将我的文本居中放置在一个 div 中(垂直和水平),但我使用的是 bootstrap3 网格系统,所以我似乎找不到适用的答案。我找到的大多数答案都需要一个表格。

这是我的标记:

<div class="row">

<div class="col-xs-4">
This is the text that I want to center...
</div>


<div class="col-xs-4">
This is the text that I want to center...
</div>


<div class="col-xs-4">
This is the text that I want to center...
</div>

</div>

最佳答案

<div class="row">

<div class="col-xs-4 text-center" style="vertical-align: middle;">
This is the text that I want to center...
</div>


<div class="col-xs-4 text-center" style="vertical-align: middle;">
This is the text that I want to center...
</div>


<div class="col-xs-4 text-center" style="vertical-align: middle;">
This is the text that I want to center...
</div>

</div>

关于html - 在 Div 中居中文本 : Bootstrap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19961458/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com