Question

I am trying to align multiple divs (buttonNav) to the bottom of a container div (lowerNav). I have read every question on here regarding this and tried the CSS and it does not seem to work. I tried this one: Stacking Divs from Bottom to Top amoung others, hoping someone can help.

Here is my html, I have 5 of the lowerNav containers each with multiple buttonNavs that I want to align to the bottom of the lowerNav here is the code from one, they are all set up the same way:

<div class="lowerNav">
  <img src="image/contact-us.gif" width="126" height="27" alt=""/>
<p>Ready to get more information or contact us directly?</p>
  <div class="buttonNav">
    <p><a href="">Order Literature</a></p>
  </div>
  <div class="buttonNav">
    <p><a href="">Downloads</a></p>
  </div>
  <div class="buttonNav">
    <p><a href="">Email Sign-Up</a></p>
  </div>
  <div class="buttonNav">
    <p><a href="">Meet Your Rep</a></p>
  </div>
  <div class="buttonNav">
    <p><a href="">Ask a Question</a></p>
  </div>
 </div>

Here is my CSS:

.lowerNav {
 width: 160px;
 height: 325px;
 background-color: #e3dfd7;
 border: 3px solid #383431;
 float: left;
 margin: 15px 8px 0px 8px;
     text-align: left;
display: table-cell;
    vertical-align: bottom;
}
.lowerNav p {
padding: 5px 12px 12px 12px;
    }
.lowerNav img {
padding-top: 12px;
    }
.buttonNav {
background:url(image/button-lowerNav.jpg);
width: 160px;
height: 45px;
display: inline-block;
    }
.buttonNav p {
text-align:center;
padding-top: 14px;
    }
.buttonNav a {
color: #fff;
font-size: 13px;
text-decoration:none;
font-weight:700;
    }
.buttonNav a:hover {
color: #fff;
font-size: 13px;
text-decoration:underline;
font-weight:700;
    }
Was it helpful?

Solution

Since the container (.lowerNav) has a fixed height and you know the size of its content this is quite easy to do with absolute positioning.

HTML:

<div class="outer">
  Hello up here!

  <ul class="inner">
    <li><a href="#">Hello</a></li>
    <li><a href="#">down</a></li>
    <li><a href="#">there!</a></li>
  </ul>
</div>

CSS:

.outer {
  position: relative;
  height: 200px;
}

.inner {
  position: absolute;
  bottom: 0;
}

Check this CodePen for a live example of this code: http://codepen.io/EvilOatmeal/pen/fCzIv

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top