FrontEnd Mentor First-challenge QR Code Component WITH HTML & CSS
Design comparison
Solution retrospective
The project is simple nothing that i'd be proud of. But next time , i wish i could do the positioning more accurate and to make it responsive .
What challenges did you encounter, and how did you overcome them?the choice of the width & height of the containers , for that i just tried some values, and for the positionning , i combined between the margin property and the position property.
What specific areas of your project would you like help with?I would like some help with :
- centering a div relatively to its parent.
Community feedback
- @AkoToSiJeromeEhPosted 7 months ago
Hey ! Great work out there i just notice that you are using position and its related properties with transfrom-translate css properties in order to center the qr code component , i suggest that you can use display properties such as grid or flex much easier and less code if you want to center something. that's all happy coding !
.container { background-color: hsl(212, 45%, 89%); width: 100vw; height: 100vh; // you are correct adding this height since it is very important especially when you want to position a element but i recommend min-height to avoid some issue like overflowing content when the content reach 100vh. margin: 0; position: relative; you can remove this display: grid;// add this place-content: center; // add this }
.holder { width: 330px; height: 480px; background-color: hsl(0, 0%, 100%); position: absolute;you can remove this top: 50%;you can remove this left: 50%;you can remove this transform: translate(-50%,-50%);you can remove this border-radius: 4%; box-sizing: border-box; }
Marked as helpful0 - @Raxel01Posted 7 months ago
very cool, nice work as you say it's a simple challenge but for beginners may like me it's a big challenge.
0 - @KushpapyPosted 7 months ago
Great Work, I really like how everything came out perfectly.
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