Align DIV to bottom of the page

前端 未结 6 1829
萌比男神i
萌比男神i 2020-12-15 16:54

I have a DIV that needs to be aligned to the bottom of a search result page, problem is whenever there is no search result or less

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-15 17:26

    Nathan Lee's answer is perfect. I just wanted to add something about position:absolute;. If you wanted to use position:absolute; like you had in your code, you have to think of it as pushing it away from one side of the page.

    For example, if you wanted your div to be somewhere in the bottom, you would have to use position:absolute; top:500px;. That would push your div 500px from the top of the page. Same rule applies for all other directions.

    DEMO

提交回复
热议问题