html - 将div放在父div的底部

标签 html css

代码:

<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/

相关文章:

javascript - 谷歌图表在 jquery 显示和隐藏时没有全宽

javascript - 在 safari 上预加载图像以更改背景图像

css - 加载 CSS、第二个 LINK 元素或@import 时,什么对速度更不利?

javascript - 将 jQuery 转换为 Angular - 单击下拉菜单中的按钮更改选项

html - 页脚没有一直延伸到页面的右边缘

html - 想要使有序列表中的数字具有不同的颜色和大小

html - 不用计算器计算标题的大小?

jquery - 启用/禁用后 Mozilla Firefox 按钮始终处于鼠标悬停状态

html - 使用 twitter bootstrap,我所有的行加起来应该是 12 行吗?

html - 将横幅与文本分开