请看这个。
http://jsfiddle.net/snw5rgx9/3/
或这个新的stackoverflow代码段。
.image {
float: left;
margin-right: 10px;
}
.text {
height: 100px;
position: relative;
}
.bottom-left {
position: absolute;
bottom: 0;
}
<div class="container">
<div class="image">
<img src="http://placehold.it/100x100" />
</div>
<div class="text">
asd
<div class="bottom-left">
Delete • Edit
</div>
</div>
</div>
我在左下方浮动的div底部的div位置有问题。
也
X | Text
| Bottom
看起来像这样。
X | Text
Bottom
在此先感谢您的信息。
最佳答案
我不确定我是否完全理解这个问题,但是请尝试为.text添加margin-left,其图像宽度值为+ 10(以对齐具有10px左边距的顶部文本,如下所示:
.text {
height: 100px;
position: relative;
margin-left: 110px;
}
http://jsfiddle.net/snw5rgx9/5/
关于html - 将div底部放在 float div中,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/26340702/