Container to grow from absolute?

Discussion in 'CSS' started by mark_s, Jun 23, 2007.

  1. #1
    Is there a way to make an absolute part of my site make the containing div grow with it's size?
     
    mark_s, Jun 23, 2007 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #2
    Huh? Do you have a link?

    Do you mean it's width, height should be semi-fixed... Not entirely sure what you are trying to accomplish...

    Though I have the suspicion you might be using an absolute when you don't have to.
     
    deathshadow, Jun 23, 2007 IP
  3. mark_s

    mark_s Peon

    Messages:
    497
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    www.murraysworld.com

    I want the news column to be first in the source code so I think having the rightbar as an absolute is the only way although it's been some time since I messed with floating the columns.
     
    mark_s, Jun 23, 2007 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #4
    This is a case for the float/margin trick commonly used in 'holy grail' type layouts... BUT.

    Even as absolute position with your layout it seems ok... So what are you trying to do with that column (I'm still not 'getting' your question)

    Define 'grow' - which axis, what is it not doing? Oh I get it... Yeah, the wording tripped me up.

    You want the container in which it's absolute position to expand if the content column is too short... You need to switch to a float/margin trick model for that, or a SEO table (yes, there is such a thing)

    Hang on, I'll link up some examples.
     
    deathshadow, Jun 23, 2007 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #5
    Ok, first up is the 'simplest' full-screen page layout method - of course being this only works full screen, it's not that useful for your site, but still worth looking at.

    http://battletech.hopto.org/for_others/3col_div.html

    Then there's the holy grail style - this version has been modded to work in a fixed width layout - I consider fixed width evil, so it's the unholy grail.

    http://battletech.hopto.org/for_others/3col_div_unholy.html

    ... and you can actually pull off SEO with tables. Because it's table based it does fullscreen and constrained equally well and has the advantage of not having to 'faux' columns. Funniest part, it's the least overall code of all the examples.

    http://battletech.hopto.org/for_others/3coltable_SEO/template.html

    Those should point you the right direction.

    Absolutes are completely removed from flow, so there's no way to constrain them. Floats on the other hand can be cleared, removing that problem... and tables, well, are the last resort when nothing else will work.
     
    deathshadow, Jun 23, 2007 IP
  6. mark_s

    mark_s Peon

    Messages:
    497
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thanks for all your advice :)
     
    mark_s, Jun 24, 2007 IP