Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Card with QR code using Html and Css

@SalvadorGuerra777

Desktop design screenshot for the QR code component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


My question is how to make a qr code like a take all the section in the card without affect the text, because when i modificate the dimensions qr code or image, the text was down and go out the card. thanks ...

Community feedback

Linas 100

@getlinas

Posted

Hi. You don't have to specify exact dimensions for image. Only set size for white container, then set image to take up 100% width of the container. I added padding later to get white border around image, but despite that image takes up 100% of width

div#qr { padding: 15px; }

img#qr-image { width: 100%; }

Basically just these 2 rules set image in right place, then adds padding/border around image and text elements.

Marked as helpful

0

@SalvadorGuerra777

Posted

@getlinas thanks bro for the time, You can follow me, and if You wanna help me more and win a points see a solutions to every one

0
Harsh Kumar 1,390

@thisisharsh7

Posted

Hi Guerra, congrats on your first solution! You did a great job. Now in order to answer your query let's take one parent container with two child, first child as 'QR code image' and other child as 'text-container'. Give parent container as display: flex then give both child as flex-grow: 1 , in this way there will be no need to manually fixing of height and width and both the child will take equal spaces in the parent container. Try the code below in your solution-

.card{ position: relative; display: flex; flex-direction: column; width: width: 360px; } 
.qr-code{flex-grow: 1}
img{width: 100%}
//no need for height value it will automatically adjust itself.

happy coding!!!!

0

Please log in to post a comment

Log in with GitHub
Discord logo

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