September 12th, 2012, 08:43 PM
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?
September 13th, 2012, 01:00 AM
Values go top, right, bottom, left
margin: 20px auto 0 auto;