gpt4 book ai didi

css - 将按钮对齐到绝对 DIV 对话框的底部

转载 作者:太空宇宙 更新时间:2023-11-04 03:36:12 25 4
gpt4 key购买 nike

到处都有人询问如何在 DIV 中对齐元素,他们被告知容器必须有一个 relative 位置。在我的例子中,我有一个 float 对话框,具有 absolute 位置。如何使按钮元素始终粘在该对话框的底部?

<div class="dialog">
<div class="dialog-content">
</div>
<button>Close</button>
</div>

最佳答案

尝试使用 absolute 定位和 bottom: 0px 为您的按钮。它将相对于 button 的父级定位,即 .dialog

是这样的:http://jsfiddle.net/0rohooj9/

关于css - 将按钮对齐到绝对 DIV 对话框的底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25525707/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com