Inline and inline-block elements are centered by setting the text-align of the parent element to center.
text-align
Block elements are centered by having the left and right margins set to auto (e.g., margin: 0 auto);
margin
auto
margin: 0 auto