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-component

#foundation
suraj sharma• 10

@surajsharma19

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 am proud of my self. I was exploring many field and didn't focus on the proper path but now I am fixing my mistake and learning in a proper manner.

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

In this solution, I try to use vanilla CSS and tried my best to do this challenge in the most simple code possible.

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

None.

Community feedback

P

@Islandstone89

Posted

Hi, you did a good job. Here is some 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(frontendmentor website).

CSS:

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

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

  • Remove the position and transform properties, they should not be used for a layout like this.

  • To center the card horizontally and vertically, use Flexbox on the body:

display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100svh;
  • The card is a <div>, which is a block element. Block elements take up the full width by default, so there is no need for width: 100%.

  • max-width must be in rem - 20rem is the size I usually recommend for this project.

  • Paragraphs have a default value of font-weight: 400, so there is no need to declare it.

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

Marked as helpful

1

suraj sharma• 10

@surajsharma19

Posted

Thank you for the feedback @Islandstone89. I will surely follow the things you have mention. I didn't use flexbox because I wanted to make this without Flexbox or Grid.

hope you are doing well and have a nice day.

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