How to center elements using the box model

A common task for web development is center elements, we can center the elements horizontal and vertically. Center horizontal Center horizontally is so easy, our element needs to have a width size, if not our element will take all space possible. Set to 0 auto the margin, the element will take the same amount of…