gpt4 book ai didi

html - 使用 Bootstrap 垂直对齐文本

转载 作者:行者123 更新时间:2023-11-28 17:52:34 25 4
gpt4 key购买 nike

尝试了这里的解决方案: vertical-align with Bootstrap 3和这里: vertical-align: middle with Bootstrap 2没用。

这是页面: http://yonicks.com/falican/exemple.htm

代码:

<div class="container">
<div class="row gray_back">
<div class="col-md-6 content_area vcenter ">

<div class="col-md-2"></div>

<div class="col-md-10 vcenter">
<h1 >text here need to be in the middle vertically</h1>
<h1 > also this</h1>
</div>


<div class="the_p_area">
<div class="col-md-2"> </div>

<div class="col-md-10">
also this also this also this also this also this also this also this also this

</div>

</div>

</div>


<div class="col-md-6">
<img src="img/fff.png" class="img-responsive" alt="Responsive image">
<br>
</div>

</div>

</div>

我使用的是最新版本的 Bootstrap。

如何使文本垂直对齐?

最佳答案

你很接近。

.row > .col-md-6 {
display: table-cell;
float: none;
vertical-align: middle;
}

关于html - 使用 Bootstrap 垂直对齐文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22002164/

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