gpt4 book ai didi

html - div 设置高度相等

转载 作者:太空宇宙 更新时间:2023-11-04 00:05:54 25 4
gpt4 key购买 nike

我有 3 个 div。如果另一个 div 高度调整,我怎样才能使它们相等。我希望我所有的 div 调整其高度,即使它们的内容较少。就像在图像中一样,即使没有数据的 div 也必须与其他的相等,并将阅读更多设置在底部。

HTML:

<div class="column-wrapper">
<div class="column-small border border-top">
<h3>Features</h3>

<ul>
<li>Code blocking</li>
<li>Code Wrapping</li>
<li>Code Killing</li>
<li>Code Sleeping</li>
</ul>

<span><a href="#">Read more</a></span>
</div>

<div class="column-small border border-top">
<h3>Modules</h3>

<ul>
<li>Barking Around The house</li>
<li>Loving the Cats</li>
<li>Floating The points</li>
<li>Coding The Sleepers</li>
</ul>

<span><a href="#">Read more</a></span>
</div>

<div class="column-small border border-top">
<h3>Idont knows</h3>
<span><a href="#">Read more</a></span>
</div>
</div>

CSS:

.column-wrapper {
padding-top: 20px;
text-align: center;
vertical-align: middle;
width: 100%;
}

.column-wrapper div {
display: inline-table;
margin: 2px;
}

.column-small {
padding: 10px;
width: 30%;
min-width: 250px;
height: auto;
}

.column-small span {
float: right;
}

.column-small ul {
margin-top: -10px;
width: 100%;
max-width: 240px;
}

.column-small ul li {
text-align: left;
}

.column-small li {
list-style: none;
padding: 5px;
text-indent: -30px;
word-wrap: break-word;
}

Screenshot

最佳答案

CSS:

.column-wrapper { overflow: hidden; }

.column-small {
float: left;
margin: 20px;
background-color: red;
padding-bottom: 1000px;
margin-bottom: -1000px;
}

.column-small span { float: right; }

.column-small ul {
margin-top: -10px;
width: 100%;
max-width: 240px;
}

.column-small ul li { text-align: left; }

.column-small li {
list-style: none;
padding: 5px;
text-indent: -30px;
word-wrap: break-word;
}

HTML:

<div class="column-wrapper">
<div class="column-small border border-top">
<h3>Features</h3>

<ul>
<li>Code blocking</li>
<li>Code Wrapping</li>
<li>Code Killing</li>
<li>Code Sleeping</li>
</ul>

<span><a href="#">Read more</a></span>
</div>

<div class="column-small border border-top">
<h3>Modules</h3>

<ul>
<li>Barking Around The house</li>
<li>Loving the Cats</li>
<li>Floating The points</li>
<li>Coding The Sleepers</li>
</ul>

<span><a href="#">Read more</a></span>
</div>

<div class="column-small border border-top">
<h3>Idont knows</h3>
<span><a href="#">Read more</a></span>
</div>
</div>

关于html - div 设置高度相等,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14891179/

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