Centering in CSS is a pain in the ass. There seems to be a gazillion ways to do it, depending on a variety of factors. This consolidates them and gives you the code you need for each situation.
Select the type of content you want to center in a parent <div>
and the size of the parent.
What do you want to center?
How big is your container <div>
?
Surprise! This site isn't just for centering. How do you want to align the content?
What is the minimum version of Internet Explorer you need to support?
With ❤ from Oliver Zheng
Follow @oliverzheng for useful things