1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Make Div Align to Bottom of Column

Discussion in 'CSS' started by infinium, Apr 1, 2008.

  1. #1
    see my illustration, which explains things.

    I want the div to align to the bottom of the right column. The content of the right column is NOT fixed, it will change from page to page.


    [​IMG]

    thanks,
    Scott
     
    infinium, Apr 1, 2008 IP
  2. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Is there going to be nothing above it?
    Why don't you just place the div at the end of what ever appears before it, so whatever is there the div will appear at the end. For example..

    <column>
    php or whatever you are using for the dynamic/changing content
    the end div
    </column>
     
    wd_2k6, Apr 1, 2008 IP
  3. infinium

    infinium Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yes, menus, content will be above.

    I want the div to be at the bottom of the column (exactly above the footer) NOT directly underneath the menus. That way it will be in a fixed position at the bottom, rather that different positions depending on content.

    thanks
     
    infinium, Apr 1, 2008 IP
  4. qazu

    qazu Well-Known Member

    Messages:
    1,834
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    165
    #4
    Is it a fixed height div? If it is, placing it div outside the right column and giving it a negative top margin should work.
     
    qazu, Apr 1, 2008 IP
  5. infinium

    infinium Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    no, this was stated in the original post. thanks
     
    infinium, Apr 1, 2008 IP
  6. qazu

    qazu Well-Known Member

    Messages:
    1,834
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    165
    #6
    I'm not talking about the right column, but the div you want align at the bottom of it. Is that div fixed height?
     
    qazu, Apr 1, 2008 IP
  7. nicangeli

    nicangeli Peon

    Messages:
    828
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #7
    
    div#id
    {
    position: relative;
    bottom: 0;
    
    }
    
    Code (markup):
    Untested. It may work?
     
    nicangeli, Apr 1, 2008 IP
  8. infinium

    infinium Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    it may, but it didn't ;) I already tried this one, and tried it by setting parent div (right column) to position: absolute

    anyone else got suggestions?

    thanks
     
    infinium, Apr 1, 2008 IP
  9. infinium

    infinium Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    sorry - yes, it will be fixed.

    and by the way, I'm open to how it gets coded, currently I have it set like this:

    
    <div id="wrapper">
    	<div id="header"></div>
    	<div id="content">
        	     <div id="content-left">Main Content Goes Here</div>
                 <div id="content-right">Right Column that Varies in Size Goes Here</div>
                 <div id="content-right-bottom">Fixed Div with Address Content</div>
                 <div id="footer">Copyright Here</div>
           </div>
    </div>
    
    
    Code (markup):
     
    infinium, Apr 1, 2008 IP
  10. maherov

    maherov Peon

    Messages:
    198
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #10
    i believe you can use pixel values to position it exactly where you want to

    check the positioning section in the css tutorials on www.w3schools.com
     
    maherov, Apr 1, 2008 IP
  11. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #11
    Make the container for the two columns {position: relative;}.

    In the right column, set padding-bottom ≥ height of the placed box.

    Make the box {position: absolute;} with right and bottom offsets adjusted to clear the borders and margins. Its parent should be the columns' parent.

    cheers,

    gary
     
    kk5st, Apr 1, 2008 IP