Mobile Responsive QR code Component using HTML and CSS
Design comparison
Solution retrospective
I learnt how to exactly make a web page responsive across all devices.
What challenges did you encounter, and how did you overcome them?Centering the division in such a way that it should be horizontally and vertically center to the body.
Community feedback
- @danielmrz-devPosted 4 months ago
Hey there! šš½āāļø
Congrats on completing the challenge! ā
Your project looks fantastic!
Here's a tip to make it even better:
Using
margin
,padding
orposition
isn't always the best way to center an element.Using
position
may cause bugs and may result in part of the content being cut off on smaller screens depending on the length of the component. It works well in this project because the card is small.Try this method to center an element vertically and horizontally:
š Apply this CSS to the body (skip position or margins to make it work correctly):
body { min-height: 100vh; display: flex; justify-content: center; align-items: center; }
Hope this helps!
Keep up the great work!
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