Not Found
Not Found
socket hang up
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 w/ Pure CSS & Mobile-First Approach

Markโ€ข 70

@Iron-Mark

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 tried Mobile-First approach with pure CSS using media queries without using classes. So I could practice my CSS selector skills. Tried to do it quickly so, it wasn't that clean. (Took me 1.5 - 2 hrs)

Any suggestion, comments, criticism for a better approach in this website? (I would really appreciate it ^_^ )

Community feedback

@MelvinAguilar

Posted

Hello there ๐Ÿ‘‹. Good job on completing the challenge !

I have some suggestions about your code that might interest you.

Alt text ๐Ÿ“ท:

  • The alt attribute should not contain underscores or hyphens, it must be human readable and understandable.
  • The alt attribute should not contain the words "image", "photo", or "picture", because the image tag already conveys that information.
  • The alt attribute should explain the purpose of the image. Uppon scanning the QR code, the user will be redirected to the frontendmentor.io website, so a better alt attribute would be QR code to frontendmentor.io

    If you want to learn more about the alt attribute, you can read this article. ๐Ÿ“˜.

CSS ๐ŸŽจ:

  • Setting the width of the component with a percentage or a viewport unit will behave strangely on mobile devices or large screens. You should use a max-width of 320px or 20rem to make sure that the component will have a maximum width of 320px on any device, also remove the width property with a percentage value.
  • A tip, instead of using flexbox and having width: 87% to center the image you could use padding on the component, this way you would create the space between the image and the component border and not repeat so much code. To give you an idea, the challenge does not require any media query, it can be made responsive for all devices just by using the necessary styles.
main > section {
    /* padding: 1rem 0rem; */
    background-color: var(--white);
    /* width: 85vw; */
    padding: 1rem;
    max-width: 318px;
    text-align: center;
}

div img {
    width: 100%;
    /* max-width: 87.5%; */
}

I hope you find it useful! ๐Ÿ˜„ Above all, the solution you submitted is great!

Happy coding!

Marked as helpful

1

Markโ€ข 70

@Iron-Mark

Posted

@MelvinAguilar Thank you! I really appreciate your effort in making this feedback! ๐Ÿ’–

0
Ahmed Mahrousโ€ข 980

@AhmedMahrouss

Posted

good jop my bro Congrats on completing your challenge!๐ŸŽŠ๐ŸปIf you have any questions or need further clarification, feel free to reach out to me. Happy Coding! ๐ŸŽ†๐ŸŽŠ

0

Markโ€ข 70

@Iron-Mark

Posted

@amahrous176 Thanks, bro! If you could give some suggestions about how it was done, I'd really appreciate it.

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