A mobile responsive QR code built using HTML and CSS Flexbox.
Design comparison
Solution retrospective
I had issues with positioning the figure tag, that houses the image tag, up against the container it is in. I ended up applying a negative top margin and that worked to move it up. I included the CSS below.
Is this a valid solution for the problem or is there another method I should have used?
Thank you and I appreciate any feedback!
figure {
height: 288px;
width: 288px;
margin: 0;
margin-top: -6px;
}
Community feedback
- @visualdennissPosted over 1 year ago
Your solutions looks great, both on mobile and desktop! Congrats on completing the challenge successfully.
Few feedback regarding the code:
i think the flex-flow column-wrap has no effect for this div you can remove that:
.max-width-container { display: flex; justify-content: center; align-items: center; flex-flow: column wrap; <-------- min-height: 100%; }
Regarding this:
figure { height: 288px; width: 288px; margin: 0; margin-top: -6px; }
it is because you have set a fixed height for the wrapper and then display: flex; justify-content: center; align-items: center;
this made it calculate item's positioning based on the available space in height and width and distributed evenly. To have those spaces evenly around it, instead of giving a fixed height to it, you can give a padding to the whole wrapper, so it has even paddings on all sides, the height must come automatically from its children's own height. One example:
for the content-wrapper: width: min-content; padding: 20px;
instead of fixed height and widths.
Hope you find this helpful!
Marked as helpful0 - @0xabdulkhaliqPosted over 1 year ago
Hello there π. Congratulations on successfully completing the challenge! π
- I have other recommendations regarding your code that I believe will be of great interest to you.
HTML π·οΈ:
- Your solution generates accessibility error reports due to
non-semantic
markup
- So fix it by replacing the
<div class="max-width-container">
with semantic element<main>
and<div class="attribution">
with semantic element<footer>
to improve accessibility and organization of your page.
I hope you find it useful! π Above all, the solution you submitted is great!
Happy coding!
Marked as helpful0
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