container div filling the page vertically

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • just a feeling
    New Member
    • Aug 2007
    • 86

    container div filling the page vertically

    Peace,

    I want the container div to fill the page vertically ( but leave a margin at the bottom with 30px).

    This is my css

    [HTML]body {
    margin: 0px;
    padding: 0px;
    }

    #container {
    background-color: #EAEAEA;
    margin: 30px auto;
    width: 780px;
    }[/HTML]

    Anyone can help,
    Thanks in advance.
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Originally posted by just a feeling
    Peace,

    I want the container div to fill the page vertically ( but leave a margin at the bottom with 30px).

    This is my css

    [HTML]body {
    margin: 0px;
    padding: 0px;
    }

    #container {
    background-color: #EAEAEA;
    margin: 30px auto;
    width: 780px;
    }[/HTML]

    Anyone can help,
    Thanks in advance.
    Have you tried setting the margin to be:

    Code:
    margin:  30px 0 0 0;
    and see if that does it? There are 4 parameters to margin:

    Code:
    margin: {top} {right} {bottom} {left};
    Hopefully that will do it.

    Regards,

    Jeff

    Comment

    • just a feeling
      New Member
      • Aug 2007
      • 86

      #3
      Thanks jeff, but not that what I want.

      My margins are working correctlly, all what I need is forcing the container div to fill the enire page vertically but leave a space for top and bottom margin around 30px.
      something like this,


      I've tried setting the height for body and div container to 100%, but it filled all the page without leaving a space at the bottom ( though the top margin is ok ).

      Comment

      Working...