gpt4 book ai didi

html - 将div放在父div的底部

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

代码:

<div id="divPopUp" style="border: 2px solid gray; padding: 20px; width: 700px; background: white; height: 450px; ">
<h1 style="text-align:center">Handsets</h1>

<table>
some table content
</table>
<div class="footerButtons" style="display: block;">
<div style="float: left;">
<input type="button"/>
</div>
<div style="float: left; margin-left: 207px;">
<input type="button"/> <input type="button"/>
</div>
</div>
</div>

我需要将类 "footerButtons" 的 div 放在主 div 的底部。我该怎么做?

最佳答案

我已将 position:relative 添加到您的主 div 和 position:absolute; bottom:10px 到你的 div 类 footerButtons 让它总是靠近底部像 this

希望对您有所帮助!

<div id="divPopUp" style="border: 2px solid gray; padding: 20px; width: 700px; background: white; height: 450px; position:relative">
<h1 style="text-align:center">Handsets</h1>

<table>some table content</table>
<div class="footerButtons" style="display: block; position:absolute; bottom:10px">
<div style="float: left;">
<input type="button" />
</div>
<div style="float: left; margin-left: 207px;">
<input type="button" />
<input type="button" />
</div>
</div>

关于html - 将div放在父div的底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31873013/

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