QR Code Component - HTML and CSS with Position
Design comparison
Solution retrospective
I have major issue with adjusting the font size according to the webpage. It always overflow if I zoom in or out. It would be awesome if someone can come up with the solution.
Community feedback
- @vanzasetiaPosted over 2 years ago
Hi there! 👋
It looks like you make this challenge more complicated than it should. There's no need for the rectangle background image. The site should only have blue background color on the
body
element.I recommend taking a look at my solution (specifically the HTML file) and trying to refactor this one by making it as simple as possible.
So, I recommend doing the following.
- Remove the background image.
- Use flexbox to put the card in the middle of the page. Don't use absolute positioning when there's a better and modern way.
- The card only needs a
max-width
to prevent it from becoming too large on wide screen sizes. So, there should not be any media queries. - I suggest making the
img
as block element and setmax-width: 100%
to make it easier to work withimg
element.
That's it! Hope this helps. Happy coding!
0 - @farukingPosted over 2 years ago
The issue I believe has to do with your usage of 'vh' for height and width. When in portrait mode, the containers scale better compared to when in landscape mode(height significantly lower than the width). One solution is to hardcode the width and height using 'px' and combining it with media queries for responsivity, Another one is to use '%' in place of 'vh'(this is actually my fav). Also, I noticed you increased the font-size of the paragraph in mobile mode without increasing the size of its container, this can cause overflow. Lastly, When done with your design, you can use this site called 'responsinator' to preview your site for responsivity.
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