SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Dec 2006
    Posts
    134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Making a container div go all the way to the bottom like the body tag

    How would I make a container div go all the way to the bottom of the page no matter if what is inside the div reaches the bottom or not?

    Basically, I want to have a background colour that is 760px in width be the background of the container div, which is centered. Then, have the div go straight from top to the bottom of the page.

    I know the body tag does this as I've tried to do this technique with a 1x760px image of the colour I wanted to use as a background and it shot down perfectly, however I need it to be a hex color so I can change it dynamically to whatever I please to whenever I want via the CMS I am building.

    Here is what I am talking about to give a better understanding in case I may have not described it clearly:


    Attached Images Attached Images

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    This is what I would do:
    Code:
    html {
      background-color:#000000;
      height:100%;
    }
    body {
      width:760px;
      margin:0 auto;
      background-color:#EEEEEE;
      height:100%;
    }
    No need for a container DIV. Make sure you have a valid DOCTYPE.

  3. #3
    SitePoint Zealot
    Join Date
    Dec 2006
    Posts
    134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah very nice Raffles, cheers!
    I guess the body tag is the only one that will do it


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •