My First Frontend Mentor Challenge for QR Code Component Challenge.
Design comparison
Solution retrospective
How I can improve my CSS skills, especially on the part of making it a bit more responsive?
Community feedback
- @JeuriMorelPosted about 1 year ago
The
<center>
tag is no longer supported by HTML. It was used to center text, not to hold content. Try changing it to something like<main>
for example. If you want to then center the content, give yourmain
the following:display: flex; justify-content: center; align-items: center; height: 100%; width: 100%;
and give your
body
a height of100vh
so that it takes the full height of the screen.Remove the following from the card:
max-width: 17%; margin-top: 160px;
Be careful when setting max-width especially when it's to a small percentage like "17%". It can lead to content that is too narrow. Try to use more controlled values. I usually use clamp when I want to have fluid sizes with min and max values. An exampled would be
width: clamp(300px, 25vw, 375px);
Remove the hardcoded
width
on theimg
and give it a width of100%
to make it fluid and consistent when the card changes sizes. Then give itdisplay: block;
. It makes working with images easier and removes a little bit of extra white space under it.Marked as helpful2
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