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 page using flexbox

Adamβ€’ 60

@AdamR22

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 issues with margin when it comes to firefox. The site may look different on firefox as compared to chrome. Any idea on how to solve this?

Community feedback

madosyβ€’ 180

@madosy

Posted

Rather than setting discrete margin values on .qr-card-and-content, I would align it to center by making the body into a flex container. The reason you don't want to use discrete margin values to align is because depending on the browser window size, your QR code component can look very different: https://imgur.com/hNuIYNs

As for the question about margins looking different on firefox vs. chrome, I wasn't able to discern any differences on my computer--the margins were the same when the window sizes were the same when I inspected each element in developer tools. I suspect that the issue may be related to setting discrete margin values but I would advise using the inspect tool yourself to check the margin values and see where the differences are. https://imgur.com/h9c0ibC

Marked as helpful

1

Adamβ€’ 60

@AdamR22

Posted

Thank you. Turning the body into a flex container helped.

1
madosyβ€’ 180

@madosy

Posted

@AdamR22 Awesome--glad to be of help!

0
Abdul Khaliq πŸš€β€’ 72,680

@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, "All page content should be contained by landmarks" is due to non-semantic markup, which lack landmark for a webpage
  • So fix it by replacing the <section class="site-content"> element with the semantic element <main> along with <section class="attribution"> into a <footer> element in your index.html file to improve accessibility and organization of your page.
  • What is meant by landmark ?, 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 ⚠️:

  • And, this solution has also generated accessibility error report due to lack of level-one heading <h1>
  • 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)

.

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

Happy coding!

Marked as helpful

1

Adamβ€’ 60

@AdamR22

Posted

Thank you.

Any recommended sites or resources that I can use to read more on accessibility?

0

@fatyga

Posted

Hi! Well done!

Here is some tips:

  1. Try to use <img> tag for qr code image instead of setting background on div(because this particular image is not designed to use it as background)
  2. Change margins units to rem or em. The % is relative to parent, and it can result with weird behaviour like in your case
  3. Also don't forget about <h1> tag which is necessary on every website and consider nesting it in <header> tag in addition.

I hope I helped.

1

Adamβ€’ 60

@AdamR22

Posted

Thank you.

If I may ask, apart from this particular instance, where the image isn't designed for background use, are there any advantage to using the <img> tag as compared to using an empty div and setting a background image to it or is it a case by case type of thing.

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