Design comparison
SolutionDesign
Solution retrospective
Es el mas sencillo que he hecho hasta ahora
Community feedback
- @Saad-HishamPosted about 1 year ago
To center the parent div on the screen, you can apply the following CSS edits:
.contenedor__general { width: 100%; min-width: 315px; margin: 0 auto; background: var(--Grayishblue); padding: 20px; min-height: 100vh; display: flex; align-items: center; /* Center vertically */ justify-content: center; /* Center horizontally */ }
In the updated CSS:
The margin property is set to 0 auto to horizontally center the element by setting equal margins on the left and right sides.
The justify-content property is set to center to vertically center the content.
These adjustments will help center the parent div on the screen both horizontally and vertically. Great job keep it up happy coding ✨
Marked as helpful1
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