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

Basic QR-Code Card template using HTML and CSS

@VanshulB

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


How can we make the card for the iPad view i.e. width of the viewport is between 600px to 760px because the card looks very awful during that size because the QR image is just too big for that region?

Community feedback

AntoineC 1,180

@AntoineC-dev

Posted

Hi Vanshul. Nice design. Congrats on completing the challenge.

Like imad said you just need to use a fixed max-width for you qr-container.

You'll also need to set the property width: 100% so the element always takes the maximum space available. This way you do not need any media query anymore.

Example:

.qr-container {
  width: 100%;
  max-width: 18.75rem;  /* 300px */
}

Then i would add some padding on the parent container so the qr-container does not stick to the sides of the window on small screen.

Example:

.container {
  background-color: hsl(212, 45%, 89%);
  width: 100%;
  /* height: 100%; */
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;

  padding: 2rem;
}

Again nice job and happy coding. Peace

1
imad 3,310

@imadbg01

Posted

Greeting Vanshul Bhatia!! Congratulations on completing Your challenge!, 👏👏👏 well done.

to solve that issue, just replace width:80% to some more specific width, like max-width: 20rem;.

example fix .

  @media only screen and (max-width: 768px)
.qr-container {
  /*  width: 80%; */
  max-width: 20rem;
}

Hope this help!!

over all, Happy Codding, and keep up the Good work

1

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