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

前端 未结 8 721
执念已碎
执念已碎 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:01

    You may not want absolute positioning because it breaks the reflow: in some circumstances, a better solution is to make the grandparent element display:table; and the parent element display:table-cell;vertical-align:bottom;. After doing this, you should be able to give the the child elements display:inline-block; and they will automagically flow towards the bottom of the parent.

提交回复
热议问题