2015-08-07 2 views
0

Код:поместить DIV в нижней части родительского DIV

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

мне нужно поставить DIV с классом "footerButtons" в нижней части главного дел. Как мне это сделать?

ответ

1

У меня есть добавить 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> 

+0

Спасибо! которые действительно помогают. –

+0

Укажите код, который вы изменили в ответе, а не только ссылку на внешний сайт. – Pete

+0

@Pete отредактирован, теперь вы можете удалить свой нижний предел? –

Смежные вопросы