A CSS layout question

Discussion in 'Web Design and Development' started by torndownunit, Feb 8, 2009.

  1. torndownunit macrumors regular

    Jan 4, 2009
    Hey guys. I have no code to post because this is just a general question.

    I am going to use 'boxes' to describe Divs just to visualize things better.

    I am looking to do a layout that has a header, a footer, and a middle content area. Probably 800 pixels wide, 90% of the page in height, and centered in the page.

    The problem is I would like the middle 'content' box to expand vertically based on whatever text/content is put into it.

    I only seem to have luck with doing the layout if the middle box is a fixed size, which a lot of times is the layout I am using anyway. But if f I try to set it up so it will expand vertically with the content, all my content just runs into my footer and makes a mess. I know I am missing something fairly simple, I just can't figure it out.

    Thanks for any help.
  2. r.j.s Moderator emeritus


    Mar 7, 2007
  3. a cat *miaow* macrumors regular

    Jun 12, 2007
    If it's as simple as the three DIVs you have there it should expand anyway.

    Do you have a height declared for the content div? If so that would cause the problem. To get a margin at the bottom of the page add a margin below the footer.
  4. Yvan256 macrumors 603


    Jul 5, 2004
    Give your center div a min-height, IMO it's what you're looking for.
  5. xx-derk9 macrumors newbie

    Jan 19, 2009

Share This Page