Design comparison
Solution retrospective
Hello All !,
I am unsure of the moethod to center the div qrcode, i wait for your review concern this.
Thanks.
Community feedback
- @finkenmannPosted almost 2 years ago
Your code has a few redundant elements. You can specify the centering directly in the body. flex and align-item: center is enough. Your .container doesn't need it anymore. The @media are completely unnecessary in this application. Just define your .qrcode with a width: min(90vw, 375px) and margin-inline: auto. This will center your element horizontally and your align-items in the body will be responsible for the vertical alignment. width:min(90vw, 375) means that depending on the viewport the smaller of the two values is used. On a narrow screen the width will be 90% of the viewport width, but with more space the element will grow to a maximum of 375px (or if you want to go bigger here, of course to a larger value). This way you need very little code and don't have to use unnecessary @mediaqueries.
Of course you have to pay attention to the warnings of the accessibility report.
Translated with www.DeepL.com/Translator (free version)
Marked as helpful0@MercatorPoeiPosted almost 2 years ago@finkenmann Thanks for your advise. I have correct my css.
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