<?xml version="1.0" encoding="utf-8"?>

CSS margin property with the auto value

CSS margin property with the auto value Bad Practice
CSS margin property with the auto value Best Practice

When it comes to centralizing elements, web developers use the margin property, which, unlike padding, can have the auto value. The margin:auto; declaration makes the element take up the specified width, while the remaining space gets equally divided between the left and right margin.

Improve your UX & Product skills with interactive courses that actually work