Handy CSS Tip: Centering a Layer
Sunday, February 20th, 2005
As easy as this may sound, the method of centering a layer on a page isn’t immediately apparent.
Originally, I tinkered with using padding of 50%, then adding a negative margin of one half the layer’s width. This method worked in most instances, but is pretty hacky, and it’s sometimes a hassle to have to calculate [...]
As easy as this may sound, the method of centering a layer on a page isn’t immediately apparent.
Originally, I tinkered with using padding of 50%, then adding a negative margin of one half the layer’s width. This method worked in most instances, but is pretty hacky, and it’s sometimes a hassle to have to calculate [...]