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

QR code component using CSS Flexbox and a Media query for mobile

jkaps9β€’ 140

@jkaps9

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


What are you most proud of, and what would you do differently next time?

Learned how to center a "card" with Flexbox on the screen.

What challenges did you encounter, and how did you overcome them?

Need to improve on making the sizing more dynamic. Currently have a media query which I think generally works, but could be more dynamic. Right now it basically just snaps down enough when it reaches 375px

What specific areas of your project would you like help with?

How do I make the sizing more dynamic as the screen size becomes smaller/bigger so that it is more fluid instead of snapping at a particular size?

Community feedback

Rebecca Padgettβ€’ 1,760

@bccpadge

Posted

Hello @jkaps9. Congratulations on completing this challenge!!!πŸŽ‰

I have a few tips to might be interested in to improve your solution.

HTML πŸ“ƒ:

  • When writing HTML keep in mind, a div is non-semantic element which tells nothing about its content and ever website should have at least one landmark
  • Attribution info should be wrapped in a <footer> tag
  • Change the <h2> to a <h1> because it is the only title on the website

More infoπŸ“š:

CSS 🎨:

  • Font size must be in rem units and not pixels
  • Adding max-width: 320px; on your card makes it responsive without using any media queries
  • Applying width or height CSS properties give elements a fixed width or height and doesn't change when go from mobile to desktop screens.

Instead of using flexbox, you can also use CSS Grid and saves you a couple lines of CSS as well.

.container{
 display:grid;
 place-content: center;
 min-height: 100vh;
 margin: 0 1rem;  /* Adds space on left and right side on mobile screens */
}

More infoπŸ“š:

To make your image responsive add max-width: 100%;

Here is my solution to this challenge - QR code component

I hope you find this useful and don't hesitate to reach out if you have any questions.

Marked as helpful

1

jkaps9β€’ 140

@jkaps9

Posted

@bccpadge Thank you so much for your detailed feedback! I have incorporated much of what you suggested above and it has certainly improved the code overall. More importantly, I have learned so much just from this one piece of feedback. I know about CSS Grid but wanted to try Flexbox for my first project on here.

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