简体   繁体   English

将div置于父div的底部

[英]put div to the bottom of parent div

Code: 码:

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

I need to put div with class "footerButtons" to bottom of the main div. 我需要将带有"footerButtons"类的div放在主div的底部。 How can I do it? 我该怎么做?

I have add position:relative to your main div and position:absolute; bottom:10px 我添加了position:relative对于您的主要div和position:absolute; bottom:10px position:absolute; bottom:10px to your div with class footerButtons to make it always near the bottom like this position:absolute; bottom:10px ,以你的分度类footerButtons使其始终像附近的底部

Hope this help! 希望有帮助!

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM