I am working on a legacy project that has CSS Reset with *{ margin:0; padding:0 }
applied to everything. Now, my new code doesn\'t need that as it relies on Nor
The simplest supported solution is to either use margin
.element {
display: block;
margin: 0px auto;
}
Or use a second container around the element that has this margin applied. This will somewhat have the effect of padding: 0px auto
if it did exist.
CSS
.element_wrapper {
display: block;
margin: 0px auto;
}
.element {
background: blue;
}
HTML
Hello world