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

Simple QR code component using CSS flexbox

Kelly CHI 210

@KellyCHI22

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


Hey there, this is my #3 challenge! Thank you for reviewing my code. Does anyone know how to fix the problem about border-radius alignment? For example, here the border radius of the card and the border radius of the qr-code image are not the same. Any smart solutions?

Community feedback

Travolgi 🍕 31,420

@denielden

Posted

Hello Kelly, You have done a good work! 😁

Some little tips to improve your code:

  • use main tag to wrap the card and improve the Accessibility but not as a container of that one element
  • also you can use article tag instead of a simple div to the container card for improve the Accessibility
  • use min-height: 100vh to body instead of height, otherwise the content is cut off when the browser height is less than the content
  • instead of using px use relative units of measurement like rem -> read here

Keep learning how to code with your amazing solutions to challenges.

Hope this help 😉 and Happy coding!

Marked as helpful

0

Kelly CHI 210

@KellyCHI22

Posted

Hi @denielden, thanks for your suggestions!

You are right, in real websites the main part shouldn't contain only one single card! I've seperated the main tag and the article tag (which is for the card component).

As for the px units, yes there are still some in my CSS, I've changed them to rems or ems. It really takes some time to get used to total relative units!

Thanks again for your suggestions, they are truely helpful :)

1
Travolgi 🍕 31,420

@denielden

Posted

@Hsin-tingCHI you are welcome and keep it up :)

0

@VCarames

Posted

Hey @Hsin-tingCHI, some suggestions to improve you code:

  • the height from the Body Element needs to be min-height.

  • The Alt Tag description for the QR image needs to be improved upon. Its needs to tell screenreader users what it is and where it will take them to when they scan it.

  • Change the width from .card__img to max-width: 100% to make it responsive.

  • Change width from **.card ** to `max-width to make the card responsive.

  • Delete all this from **.card ** its unnecessary and just bloating your code :

.card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

Happy Coding!

Marked as helpful

0

Kelly CHI 210

@KellyCHI22

Posted

Hi @vcarames, thanks for your suggestions!

Its sure that I didn't notice those display properties on .card are not doing anything. I've deleted all of them, thank you!

As for other suggestions, I've also updated all of them :) I really need to work harder on practicing resposiveness.

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