#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    1
    Rep Power
    0

    Fixed vertical position, auto margins for horizontal?


    I am attempting to center a content box, but I want its vertical position on the page to remain fixed.

    More specifically: I have a background image I would like this content box to remain below, but I would like the content to be centered horizontally. In order to center the content horizontally, I am using auto margins left and right. But the content remains at the top of the page, although it is centered horizontally. Is there any way to control the height of the element on the page?
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    119
    Rep Power
    33
    Code:
    #content-box {
      margin: 20px auto 0 auto;
    }
    Values go top, right, bottom, left

IMN logo majestic logo threadwatch logo seochat tools logo