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

Responsive QR code using only CSS flexbox

aumvashishtā€¢ 10

@aumvashisht

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


while scrolling at the smaller height I am finding difficulty to adjust the QR code

Community feedback

@Priyesh-Singh-Waldia

Posted

To fix the QR code issue

you can remove the height property from your box class, its restricting the height of your box to 55vh cause 1vh is relative to 1% of the height of the viewport

try it out, that should fix the problem.

Marked as helpful

0

aumvashishtā€¢ 10

@aumvashisht

Posted

@Priyesh-Singh-Waldia Thanks! It worked but I have a doubt when we use align-items: center; we also need to specify the height by compulsion right if I don't specify the height then how will it align it to the center?

0

@Priyesh-Singh-Waldia

Posted

@aumvashisht You are welcome!

The align items: center, is used to align the items along the cross-axis inside of an HTML Element you have set as display: flex

( in your case element div with the class .bigger-box is the container ) and you have already set the height as 100vh for the same.

if you remove the height value, then all the elements will stick to the top of the page cause a div without any specified width and height or even any characters is of 0px in size, you can try this out by deleting everything inside your div with the class .box

as for your .box class with flex-direction: column, there is only the width property set at 250px, that's the reason why all the text inside is getting wrapped inside the div.

if you remove the width property, then the entire paragraph will render in one line ( taking up the as much space needed by the characters to fit inside the item set as display: flex)

as for your previous qr code issue if you change the unit of height from vh to px then it will remain at a fixed height cause the unit vh adjust according to the display height (1vh is relative to 1% of the height of the viewport)

For Ex:

if the total height of your display is 1000px then 1vh would mean 10px.

if the total height of your display is 500px then 1vh would mean 5px.

Hope, this helps you out with your CSS learning journey šŸ˜Š

Marked as helpful

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