Responsive QR code component using HTML & CSS

Solution retrospective
Please review the code and let me know if you have any suggestions for improving it.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @davinceey
Hello Mohit. Congratulations on your first project! This is apt and great on the whole. Just some little tips for improvement:
-
You might want to replace the
p
tag used in the first write-up, with ah1
tag, so that your<main>
tag, has a level-one heading. -
You might as well, want to use more of relative units such as the
em
andrem
in applying to padding, margins, widths and font-sizes. This would help to increase the responsiveness of your layout.
You did very well. Keep up!
Hope this helps you. Happy Coding!👊
Marked as helpful -
- @correlucas
👾Hi Mohit, congratulations for your first solution!👋 Welcome to the Frontend Mentor Coding Community!
Great solution and great start! By what I saw you’re on the right track. I’ve few suggestions to you that you can consider to add to your code:
Your component is perfect, but is not responsive yet, this is due the
fixed width
you've applied to the container.Look both
width
andmax-width
the main difference between these properties is that the first(width) is fixed and the second(max-width) isflexible
, for example, a component withwidth: 320px
will not grow or shrink because the size will be ever the same, but a container withmax-width: 320px
ormin-width: 320px
can grow or contract depending of the property you've set for the container. So if you want a responsive block element, never usewidth
choose ormin-width
ormax-width
.Note that there's no need to use
height
here, because since you set aheight
for an element, this means that this element will grow until a certain point and after that the inner content (as texts or images) will start to pop out the element due its fixed height, so isn't necessary to set theheight
the container height comes from the elements, its paddings and height.✌️ I hope this helps you and happy coding!
Marked as helpful
Join 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