How can I send an inner
to the bottom of its parent
?

前端 未结 8 730
执念已碎
执念已碎 2020-11-30 17:25

The div inside another div picture and code below. Because there will be text and images of the parent div. And red div will be the last element of the parent div.

<

8条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-30 18:03

    Here is way to avoid absolute divs and tables if you know parent's height:

    
    

    CSS:

    .parent {
        line-height:80px;
        border: 1px solid black;
    }
    .child {
        line-height:normal;
        display: inline-block;
        vertical-align:bottom;
        border: 1px solid red;
    }
    

    JsFiddle:

    Example

提交回复
热议问题