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 Using CSS & HTML5

Angela Mooreβ€’ 160

@Cyber-Chic

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 have completed the QR code component! Please let me know your thoughts!

QUESTIONS:

-I used negative margins in my code. Is it OK to do that going forward?

-I used a <h3> heading instead of solely using <p> tags. Was it OK that I deviated slightly from the style guide?

-Was it OK to add the QR image to GitHub, save it as a https:// link and add the URL to my code?

-I tried to drag and drop the .gitignore file to GitHub, but the file was listed as hidden and would not upload. Was it OK that I created a new .gitignore file on GitHub then copied and pasted everything into that file? Also, did I need to add that file?

-Does my code follow best practices? How can I tell if it does?

-I used: min-width: 375px; and max-width: 1440px; in the body CSS to account for the mobile and desktop dimensions specified in the style guide. Was that correct?

-Did I upload everything that I was supposed to? For example, I did not upload the fav-icon image that was included in my HTML code, the image folder or the design folder.

-Should I have added a separate CSS folder?

-Does my code read well / should I style it differently?

-Do you have any additional feedback?

Thank you for your help!! :)

-Angie

Community feedback

@MelvinAguilar

Posted

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

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

  • I don't see any negative margin values and I believe they are not necessary.
  • You can use the tags you need, just avoid skipping headings elements, start with <h1> and not with <h3>, and you can achieve the same result using font-size in the CSS code.
  • You can upload the image to your Github repository, the challenge is not too big and it will not affect performance. Also, by using an external image, you are making an extra request.
  • The numbers 375px and 1440px are the dimensions of the images, you don't have to set the width of the body to those values. Otherwise, on 4k screens, your element will not be centered.
  • You should not use inline-CSS (CSS in the html code) because it is not a good practice. Instead, you should use an external stylesheet to style your page. By doing this, you will be able to have a better organization of your code and will be able to understand it better.
  • I think you have to upload the images folder and the favicon to your repository.
  • There are too many <br> tags, you are cluttering the HTML code a lot, you can achieve the same result using margins.
  • Avoid using position: absolute to center an element as it may result in overflow on some screen sizes. Instead, utilize the flexbox or grid layout for centering. Get more insights on centering in CSS here here πŸ“˜.

I hope you find it useful! πŸ˜„

Happy coding!

Marked as helpful

2

Angela Mooreβ€’ 160

@Cyber-Chic

Posted

@MelvinAguilar

This is wonderful feedback!! You cleared up a lot of the initial confusion I had when creating this. I will start implementing these changes to my site. Thank you so much for the great responses to my questions - Very helpful!

I really appreciate your help with this! πŸ˜„

Happy coding!

0
Vanza Setiaβ€’ 27,795

@vanzasetia

Posted

Hi, Angela Moore!

About your questions:

  1. I don't see any margin property in the index.html.
  2. Don't use heading tags for styling purposes! Heading tags are used to structure the page. Meaning, they are meaningful elements. You should use <h1> and adjust the size of the text using CSS. Dive deeper β€” How-to: Accessible heading structure - The A11Y Project
  3. It's absolutely fine to put the QR code image in your GitHub repository. In fact, you should do that instead of separately hosting the image. This way, you can keep track of the image easily.
  4. Use the .gitignore that comes from the starter files. Then, move it to the project folder on your local machine. Then, upload the file using git command.
  5. That's hardβ€”or even impossibleβ€”to know whether you have been following best practices. Also, what do you mean by "best practices"? I recommend for getting started, making sure your code has no issues, is valid, and does a Lighthouse audit.
  6. 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". As a front-end developer, you should make your website looks good at all screen sizes, including smaller, larger, and everything in between.
  7. I recommend uploading everything that you get from the starter files.
  8. It's up to you to create a new CSS folder or not, at least for this project.
  9. I recommend using a code-formatter. This way, your code base will have a consistent format, which makes it easier to read the code. I suggest using Prettier as your code-formatter. My recommendation β€” Prettier Β· Opinionated Code Formatter

Some feedback:

  • Remove all <br> elements. Don't use them to create spacing between elements. Screen readers may announce them as "break" which creates unnecessary noises. Use CSS instead. Learn more β€” <br>: The Line Break element - HTML: HyperText Markup Language | MDN #accessibility_concerns
  • Remove width, min-width, and max-width from the <body> styling. It should always fill the entire page. Treat it as the main element of the web page.
  • Use flexbox or grid to place the card in the center of the page. These modern techniques are more robust than absolute positioning and have less code to write.

I hope you find this useful.

Marked as helpful

1

Angela Mooreβ€’ 160

@Cyber-Chic

Posted

@vanzasetia

Hi, Vanza Setia!

This is excellent feedback. Thank you so much for addressing all of my questions and providing additional resources. I especially like the Prettier Β· Opinionated Code Formatter! Also, I've heard there's an informal set of coding best practices / standards. Your suggestion to make sure there are no issues, that everything is valid, and to do a Lighthouse audit sounds like a wonderful course of action. I will start implementing your changes to my site. Thank you so much for the extremely helpful critique.

I really appreciate all your help! πŸ˜„

Happy coding!

0
Vanza Setiaβ€’ 27,795

@vanzasetia

Posted

@Cyber-Chic

You are welcome! Happy coding too! πŸ‘

1
Abdul Khaliq πŸš€β€’ 72,660

@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.

HTML 🏷️:

  • This solution generates accessibility error reports due to non-semantic markup
  • So fix it by replacing the <div class="image"> with semantic element <main> to improve accessibility and organization of your page.
  • What is meant by landmark elements ?, They used to define major sections of your page instead of relying on generic elements like <div> or <span>
  • They convey the structure of your page. For example, the <main> element should include all content directly related to the page's main idea, so there should only be one per page

HEADINGS :

  • Every site must want at least one h1 element identifying and describing the main content of the page.
  • An h1 heading provides an important navigation point for users of assistive technologies, allowing them to easily find the main content of the page.
  • So we want to add a level-one heading to improve accessibility by reading aloud the heading by screen readers, you can achieve this by adding a sr-only class to hide it from visual users (it will be useful for visually impaired users)

IMAGE :

  • Since this component involves scanning the QR code, the image is not a decoration, so it must have an alt attribute. The alt attribute should explain its purpose. e.g. alt="QR code to frontendmentor.io"

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

Happy coding!

Marked as helpful

1

Angela Mooreβ€’ 160

@Cyber-Chic

Posted

@0xAbdulKhalid

Thank you so much for the detailed response!! This is a fantastic breakdown and extremely helpful. I'm going to work on implementing these changes into my site!

I really appreciate all your help! πŸ˜„

Happy coding!

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