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

I only used HTML and CSS, also I used the CSS @media to make it better

@RogerTito455

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?

I really like how my mind has think of how i could make that exactly as the example

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

The first challenge I found was of how to make it for mobile devices, but I found a website which help me during this process.

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

I would like to know If I could do the code smaller to make it more eficcient.

Community feedback

P

@Islandstone89

Posted

Hey there, well done!

My feedback:

HTML:

  • Every webpage needs a <main> that wraps all of the content, except for <header> and footer>. This is vital for accessibility, as it helps screen readers identify a page's "main" section. Wrap the card in a <main>.

  • The alt text should be written naturally, without using - between the words. Write something short and descriptive, without including words like "image" or "photo". Screen readers start announcing images with "image", so an alt text of "image of qr code" would be read like this: "image, image of qr code". The alt text must also say where it leads(the frontendmentor website). A good alt text would be "QR code leading to the Frontend Mentor website."

CSS:

  • Including a CSS Reset at the top is good practice.

  • Use the style guide to find the correct font-family, and remember to specify a fallback font:font-family: 'Outfit',sans-serif;

  • I like to add 1rem of padding on the body, to ensure the card doesn't touch the edges on small screens.

  • On the body, change height to min-height - this way, the content will not get cut off if it grows beneath the viewport.

  • max-width on the card must be in rem - I would change it to 20rem, which equals 320px.

  • On the image, add display: block and change width to max-width: 100% - the max-width prevents it from overflowing its container.

  • Instead of using descendant selectors like .text-container h2, it is recommended to add a class to an element, for example:<h2 class="card-heading">.

  • As the design doesn't change, there is no need for any media queries. When you do need them, they should be in rem or em, not px. Also, it is common practice to do mobile styles first and use media queries for larger screens.

Marked as helpful

0

@baturalperbay

Posted

Hello RogerTito, well done on your solution :)

For mobile devices, one trick that is used often is to make width of containers in percentages. Try setting width: 90% on your container and see how it behaves.

It is good that you are using rem units, you can also check out "container query length"s at Container Queries. However this is absolutely not high priority whatsoever and it should be noted that browser support for Container Queries is still inadequate.

Happy coding :)

Marked as helpful

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