Design comparison
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
- @getlinasPosted over 1 year ago
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 helpful0@SalvadorGuerra777Posted over 1 year ago@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 - @thisisharsh7Posted over 1 year ago
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 asflex-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 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