gpt4 book ai didi

html - 与表格单元格垂直对齐

转载 作者:太空宇宙 更新时间:2023-11-03 23:02:10 24 4
gpt4 key购买 nike

我不知道如何让每个“View Jobs”在底部垂直对齐。这是一个 jsfiddle https://jsfiddle.net/2ffm8gna/5/

HTML:
<div class="row">
<div class="item">
<h5>Admin</h5>
<p>Apply your skills and experience to any number of functional areas where customer satisfaction is the top priority.Apply your skills and experience to any number of functional areas where customer satisfaction is the top priority.</p>
<a href="#">View Jobs</a>
</div>
<div class="item">
<h5>Marketing</h5>
<p>Be part of an inspired team responsible for ensuring brand integrity and championing the MD Value Proposition out in the world.<br /></p>
<a href="#">View Jobs</a>
</div>
</div>

CSS

     .row {
display: table!important;
}
.item {
display: table-cell!important;
width:45%;
height:300px;
border:2px solid blue;
}
.item a {
vertical-align:bottom!important;
color:red;
display: table-cell!important;
}

我在这里错过了什么?

最佳答案

您可以为此使用绝对定位:

.item {
position: relative;
}

.item a {
position: absolute;
bottom: 0;
}

JSFiddle

关于html - 与表格单元格垂直对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36068130/

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