gpt4 book ai didi

html - 响应式 html 布局高度 100% 不是根据父 div

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

我真的是 html 新手

这是我的代码

<div class="w3-row">
<div class="w3-container w3-half w3-padding-64 w3-orange w3-text-white w3-center" style="height:100%">
<p style="font-size:calc(11px + 1vw);"> OUR <b>VISION</b></br></br>
To become the best foundation that is able to nurture holistic global leaders</p>
</div>


<div class="w3-container w3-half w3-padding-64 w3-orange w3-text-white w3-center" style="height:100%">
<p style="font-size:calc(11px + 1vw);"> OUR <b>MISSION</b></br></br>
Developing young muslim leaders by nurturing entrepreneurial mindset in order to provide the best
solution for mankind through Islamic values</p>
</div>
</div>

所以我有 2 列连续。事情是这样的

my first column leaves empty white space below it

有没有办法让我的两个列都扩展到 100% 父 div 的高度?

最佳答案

使用 flex

.w3-row{
display: flex;
align-items: center;
}

.w3-container {
flex: 1;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="w3-row">
<div class="w3-container w3-half w3-padding-64 w3-orange w3-text-white w3-center" style="height:100%">
<p style="font-size:calc(11px + 1vw);"> OUR <b>VISION</b></br></br>
To become the best foundation that is able to nurture holistic global leaders</p>
</div>


<div class="w3-container w3-half w3-padding-64 w3-orange w3-text-white w3-center" style="height:100%">
<p style="font-size:calc(11px + 1vw);"> OUR <b>MISSION</b></br></br>
Developing young muslim leaders by nurturing entrepreneurial mindset in order to provide the best
solution for mankind through Islamic values</p>
</div>
</div>

关于html - 响应式 html 布局高度 100% 不是根据父 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44926380/

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