Basic QR-Code Card template using HTML and CSS

Solution retrospective
How can we make the card for the iPad view i.e. width of the viewport is between 600px to 760px because the card looks very awful during that size because the QR image is just too big for that region?
Please log in to post a comment
Log in with GitHubCommunity feedback
- @mattari97
Hi Vanshul. Nice design. Congrats on completing the challenge.
Like imad said you just need to use a fixed
max-width
for you qr-container.You'll also need to set the property
width: 100%
so the element always takes the maximum space available. This way you do not need any media query anymore.Example:
.qr-container { width: 100%; max-width: 18.75rem; /* 300px */ }
Then i would add some padding on the parent container so the qr-container does not stick to the sides of the window on small screen.
Example:
.container { background-color: hsl(212, 45%, 89%); width: 100%; /* height: 100%; */ min-height: 100vh; display: flex; justify-content: center; align-items: center; padding: 2rem; }
Again nice job and happy coding. Peace
- @imadvv
Greeting Vanshul Bhatia!! Congratulations on completing Your challenge!, 👏👏👏 well done.
to solve that issue, just replace
width:80%
to some more specific width, likemax-width: 20rem;
.example fix .
@media only screen and (max-width: 768px) .qr-container { /* width: 80%; */ max-width: 20rem; }
Hope this help!!
over all, Happy Codding, and keep up the Good work
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