【问题标题】:How to align image at the bottom of this div?如何在这个 div 的底部对齐图像?
【发布时间】:2016-12-21 01:42:30
【问题描述】:

我有 3 张图片,想这样展示它们:

AABB
AABB
AACC
AACC

A,B,C 是图像。因为 A 的高度不是 B 和 C 的高度之和,所以我想显示 A 与 C 的底部对齐。

这是我现在使用的代码:

<div class="logo-wrap">

    <div class="site-title" style="position: relative;  " >
        <a href="@Url.Action("Index", "Home")">
        <img src="~/Images/girl.png"  />
        </a>
    </div>
    <div class="site-sub-header">
        <img src="~/Images/logo.png" style="height:75%;" />
        <br/>
        <img src="~/Images/icons.png" style="height:75%; " />
    </div>                

</div>

基于 How do I position an image at the bottom of div? ,我将 logo-wrap 设置为

position: relative; 

然后将girl.png图像设置为

position: absolute;
left: 0;
bottom: 0;

但它不起作用。有人有建议吗?

谢谢

【问题讨论】:

  • 你能做一个小提琴吗?
  • 这是你想要达到的吗? DEMO

标签: html css


【解决方案1】:

用途:

display:inline-block;

组织行例如:“AABB”。

我不认为:

position:absolute;

这是一个很好的解决方案。

【讨论】:

    猜你喜欢
    • 2014-08-05
    • 2016-05-27
    • 1970-01-01
    • 1970-01-01
    • 2015-11-12
    • 1970-01-01
    • 1970-01-01
    • 2011-09-25
    • 1970-01-01
    相关资源
    最近更新 更多