Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    May 2008
    Posts
    446
    Thanks
    23
    Thanked 5 Times in 5 Posts

    need to position a div at the bottom

    I am trying to position a div at the bottom inside another div.

    I have tried:

    Code:
    .nested_div
    {
    position: absolute;
    bottom: 0px;
    }
    Code:
    .nested_div
    {
    position: relative;
    bottom: 0px;
    }
    Code:
    .nested_div
    {
    position: absolute;
    bottom: -1px;
    }
    Code:
    .nested_div
    {
    verical-align: bottom;
    }
    The last one has never worked for me, but thought I would try it.

    Any ideas?

  • #2
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    Code:
    <div class="container">
       <div class="bottom">
       </div>
    </div>
    Code:
    .container {
     position: relative;
     height: 200px;
     width: 400px;
    }
    
    .container .bottom {
     position: absolute;
     bottom: 0;
     height: 30px;
     width: 100%;
    }
    When you set the containing div to :relative, you can absolute anything within that div or tag in general.
    http://css-tricks.com/791-absolute-p...e-positioning/

    vertical-align is only for inline elements (a, img, span)
    Last edited by Sammy12; 07-08-2011 at 08:28 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •