Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make div stick to bottom of another div (not bottom of viewport)

Tags:

css

How can I make a div stick to the bottom of the parent div, not necessarily the bottom of the viewport? I still want to place content below the parent div.

I'd like to do this with cross-browser compatibility and no JS if possible.

like image 318
iliketolearn Avatar asked Sep 25 '15 01:09

iliketolearn


1 Answers

Read up about css position: http://www.w3schools.com/css/css_positioning.asp

Basically you can position a div with absolute anywhere within a parent that has position relative.

.parent {
    position: relative;
}

.child {
    position: absolute;
    bottom: 0;
}
like image 184
ngearing Avatar answered Oct 18 '22 12:10

ngearing