gpt4 book ai didi

html - 如何清除上面 2 个 div 中的第三个 div?

转载 作者:行者123 更新时间:2023-11-28 16:40:42 25 4
gpt4 key购买 nike

这就是我要解决的...

<div class="post">

<div class="date">
<div class="day">01</div>
<div class="month">Jan</div>
</div>

<div class="post-info">
<h2><a href="#">Donec commodo et justo ac bibendum. Lorem ipsum dolor sit ametit</a></h2>
</div>

</div>

<div class="post">

<div class="date">
<div class="day">01</div>
<div class="month">Jan</div>
</div>

<div class="post-info">
<h2><a href="#">Donec commodo et justo ac bibendum. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a></h2>
</div>

</div>

<div class="post">

<div class="date">
<div class="day">01</div>
<div class="month">Jan</div>
</div>

<div class="post-info">
<h2><a href="#">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin facilisis mi tellus, at venenatis justo fermentum at. Ut sed nulla leo. Quisque pulvinar massa ut velit porttitor imperdiet. Ut sit amet sollicitudin lacus, at tincidunt mauris. Donec commodo et justo ac bibendum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin facilisis mi tellus, at venenatis justo fermentum at. Ut sed nulla leo. Quisque pulvinar massa ut velit porttitor imperdiet. Ut sit amet sollicitudin lacus, at tincidunt mauris. Donec commodo et justo ac bibendum. </a></h2>
</div>

</div>

http://jsfiddle.net/kaZ6H/1/

我希望第 3 个 div 的内容像这样被清除 http://i.imgur.com/dRxLTrI.jpg

我不想为元素应用高度。还有其他方法可以实现吗?

最佳答案

你可以给 div 一个表格单元格的显示:

.date, .post-info {
display:table-cell;
}

jsFiddle example

关于html - 如何清除上面 2 个 div 中的第三个 div?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21290823/

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