CSS Centering

Horizontal centering.

When the element to be centered is an inline element we use text-align center on its parent.

When the element is a block level element we give it a width and set the left and right margins to a value of auto.

Vertical centering

The values for vertical-align have meaning with respect to a parent inline element.

Continue reading “CSS Centering”