html - 底部对齐 div 中的链接

标签 html css

我有类似的东西

.col {float: left; width:190px;border: 1px solid red;}

<div class="col">
    <p>some text goes here some ass sasass here </p
</div>
<div class="col">
   <p>some text goes here</p>
   <a href="">Link</a>
</div>

所以第一个 div 中的文本很长,而第二个 div 中的文本则不是。所以第一个 div 比第二个 div 高。

我想要实现的是将文本保留在第二列中,但将链接垂直对齐到底部以匹配左侧的 div 高度。

这有意义吗?

谢谢

最佳答案

看这个例子:
http://www.ejeliot.com/samples/equal-height-columns/example-6.html

添加:
你应该把你想放在底部的元素拿出来。

<div class="col">
    <p>Lorem ipsum dolor 1</p>
</div>
<div class="bottom"></div>

<div class="col">
    <p>Lorem ipsum dolor 2</p>
</div>
<div class="bottom">
    <a href="#">link</a>
</div>

关于html - 底部对齐 div 中的链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4267932/

相关文章:

php - 链接文件(样式表、脚本文件、图像等)

jquery - $.append() 和 $.append(document.createTextNode()) 之间的区别

jquery - Bootstrap 弹出窗口中的星级评分

javascript - 如何在 div 中使用拖动功能

css - 样式化 HTML5 数字输入

html - 即 : border-radius with background is not smooth

javascript - Angular : Implementing ng-click in directive with DOM manipulation?

javascript - 旋转放置在圆圈上的图像列表 <li> 点击任何 child 到给定位置

css - Fontawesome : How to control height and width of stacked icons

html - href 删除所有样式