Centering divs with css


We have many different ways to center our content with css using an inner and an outer div. What we need to have in mind, is that inner div, should always be less width than the outer one.

Below, i will be attaching a couple of methods to centerize:

Our HTML:

Method 1:

Method 2 – option 1:

Method 2 – option 2:

Method 3: