The modern way of centering in CSS
Here’s the more traditional way of centering things with css.
.something {
display: flex;
justify-content: center;
align-items: center;
}
Here’s the newer way of centering things.
.something {
display: grid;
place-items: center;
}
Shorter. Cleaner. Gets the job done.
Read more about the place-items CSS property here.
That’s all. Happy coding!