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

Flexbox QR code component

@abyanfalah

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


I'm still unsure why the instructions give me two screen size. And i don't know if my solution is "responsive design". But i do limit the content width to 350px so it doesn't go too wide.

And please give example of best practices for this challenge. Thankyou.

Community feedback

@0xabdulkhaliq

Posted

Hello there 👋. Congratulations on successfully completing the challenge! 🎉

  • I have other recommendations regarding your code that I believe will be of great interest to you.

COMPONENT MEASUREMENTS 📐:

  • Use min-height: 100vh for div(.centered) instead of height: 100vh. Setting the height: 100vh may result in the component being cut off on smaller screens.
  • For example; if we set height: 100vh then the div will have 100vh height no matter what. Even if the content spans more than 100vh of viewport.
  • But if we set min-height: 100vh then the div will start at 100vh, if the content pushes the div beyond 100vh it will continue growing. However if you have content that takes less than 100vh it will still take 100vh in space.

.

I hope you find this helpful 😄 Above all, the solution you submitted is great !

Happy coding!

Marked as helpful

1

@abyanfalah

Posted

@0xAbdulKhalid Hi, thank you very much for the feedback!

I didn't know it will be so if i don't set the min-height instead. But now i know! Thank you very much.

Please also give feedback for my submission upcoming!

0
Vanza Setia 27,795

@vanzasetia

Posted

Hi, Yafi Abyan! 👋

The sizes on the style-guide.md have nothing to do with the media queries. They are telling you that "this is how your website should look like at these screen sizes". In short, they are just guides.

I recommend wrapping the text with semantic HTML elements like a heading and a paragraph element. There should not be text in <span> and <div> alone.

I recommend using semantic HTML because of the following reasons.

  • It gives tools or assistive technologies such as screen readers the information about the website like the page structure.
  • If the CSS fails to load, the browser's user agent stylesheet will get applied. So, the page still makes sense.

Learn HTML at web.dev

Never use 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. Learn more — Why you should never use px to set font-size in CSS

I recommend making the <body> element as the flex container of the card. Then, use the <main> element as the card. This way, you do not need extra <div> elements.

I hope this helps. Happy coding! 👍

Marked as helpful

1

Vanza Setia 27,795

@vanzasetia

Posted

@abyanfalah

The card is responsive. 👍

It can shrink on small screen sizes and grow until the specified max-width value.

If you were using width, then the card will not allow to shrink or not responsive.

Marked as helpful

1

@abyanfalah

Posted

@vanzasetia Thank you very much for the input. This made me realize i don't know much about creating even a proper HTML page.

I think i'll get into HTML semantics right away. Please also give feedback for my submission in the future.

Thank you very much!

1

@abyanfalah

Posted

@vanzasetia Thank you for informing me. While i know the concept of responsive design, i'm having difficulty implementing them into code.

Please also give feedback for my submissions upcoming.

Thank you!

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