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 challenge using flexbox to center the card.

tony/c.dev 130

@tony1c

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


any more tips?

Community feedback

Vanza Setia 27,795

@vanzasetia

Posted

Hi, Tonyy!

For the size of the card, you only need to set a max-width to prevent it from filling the entire page while still allowing it to shrink if needed.

Some more suggestions from me:

  • Remove width: 1440px from the body element. It makes the site looks bad on a lot of devices.
  • Remove width: 16% from the card or .container. It makes the card looks small on some some screen sizes (after you apply my first suggestion).
  • Set max-width to the card element with the static unit (rem or px).
  • Use a CSS reset whenever you start a new project. This can help you set the styling foundation easily. A Modern CSS Reset

Avoid using px unit for font sizes. Use rem or em instead. Relative units such as rem and em can adapt when the users change the browser's font size setting.

I hope this helps. Happy coding!

Marked as helpful

1

tony/c.dev 130

@tony1c

Posted

@vanzasetia It does help a ton! Thank u for ur time! I'll do it the right way now :d

0
Vanza Setia 27,795

@vanzasetia

Posted

@tony1c I am happy to know my feedback helped. 🙂

1
Saulius K. 560

@TH3RIV

Posted

Hi, @tony1c!

Your project is nearly finished. All it needs is a few adjustments:

  • It should contain landmarks within your body tags, in this project your card should be between main tags and your attribution should be between footer tags. Not using landmarks is considered bad practice and makes it harder to read the code.
  • Try to avoid using px values as much as possible and use rem instead.
  • Look into using flexbox to center your elements and try to never declare width on the body, by default it is set to full screen width possible.
  • Card size can be set with .card {max-width: 350px (yes it's okay to use px here)}.
  • You can wrap the title and the description in the same container, so it will always keep them same width when you apply padding or margin to it.
  • Try to start using custom CSS properties. While it's not essential in this project, it is a good habit to develop.

Hope this helps!

Marked as helpful

1

tony/c.dev 130

@tony1c

Posted

@TH3RIV Thank u for ur time. I fully understood what I did wrong and i'll immediatly make up for the things i messed up! Helped a ton!

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