Design comparison
Solution retrospective
πThings that were difficult:
- Getting a downward triangle below the share button: Not sure what the best approach is to achieving this.
- Getting a smooth transition to a responsive design: Was not able to create the right sizing in the mobile version of the site.
Would love to hear any feedback π
Community feedback
- @md5daltonPosted about 2 years ago
Hello Neil π
To center the card perfect in the page use flex box:
body { display: flex; align-items: center; justify-content: center; flex-direction: column; min-height: 100vh; /* padding-top: 20rem; */ }
If you want to make your site responsive, I'd suggest you to go with mobile first approach which means all default styles are for mobile and then define media queries for bigger screen devices. I'll demonstrate:
.article-container { min-width: 300px; max-width: 730px; } /* Large Devices */ @madia (min-width: 768px) { .article-container { display: flex; align-items: center; } }
This way you only have to define the flex box for larger screen devices. Also add some side padding on
body
to make sure the card doesn't flush against viewport edges.padding: 0 1rem;
as an example. π0 - @AbdallaRahmahPosted about 2 years ago
nice work Nell, i like your work and i have some ideas for you:
-
instead of adding a large padding to the body element you can add min-height: 100vh and justify content: center this will help you center the main element.
-
also you can remove the article-container div and duplicate its styles to the main tag.
best of luck for you.
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