Design comparison
SolutionDesign
Community feedback
- @mreed4Posted about 1 year ago
Centering on a web page has come a long way since I first started teaching myself all of this stuff so long ago. One way to do it, a modern way that probably now has enough coverage across enough browsers, is to set the CSS as something like the following:
body { display: flex; justify-content: center; align-items: center; height: 100vh; } .container { /* This represents the main div of your page/app */ margin: auto; width: 20rem; background-color: var(--very-dark-blue-card); padding: 1.25rem; border-radius: 1rem; }
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord