Liquid Vertical Alignment ARGH!!

Discussion in 'CSS' started by welgood, Nov 23, 2008.

  1. #1
    EDIT: Nevermind, I worked it out. I changed the div positions to relative from absolute (if anyone else has the same problem) :)

    I've been searching around for the past hour and cannot find any explanation of how to do this.

    So I have 2 divs stacked on top of each other. If the content in the first div shrinks, the div below it needs to rise by the amount the content shrank by (so if the content height shrank by 15px, then the "top" attribute of the other div needs to reduce by 15 px, otherwise there would be a gap between div #1 and div #2).

    The same would apply if the height increased (obviously).

    So is there a way to do this? I don't want to have to change the position manually every time I change the content.
     
    welgood, Nov 23, 2008 IP
  2. tsiger

    tsiger Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Is there an example somewhere so we can see the code? :)
     
    tsiger, Nov 23, 2008 IP
  3. welgood

    welgood Active Member

    Messages:
    102
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Just wrote up an example for you:

    The CSS
    The HTML
    Quite simple really :)
     
    welgood, Nov 23, 2008 IP