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

HTML,CSS

Sheetal 190

@sheetal1409

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


Could anyone please help me fix the white space issue for mobile width 375px .

Community feedback

@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 causes lacking of landmark for a webpage
  • So fix it by replacing the <div class="main"> element with the semantic element <main> 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 are use to provide a more precise detail of the structure of our webpage to the browser or screen readers
  • 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

Sheetal 190

@sheetal1409

Posted

@0xAbdulKhalid Thank you for the feedback . I will update it accordingly .

0

@SoniBasant

Posted

Hey Sheetal,

I made some changes and send a pull request to you in your GitHub. Please see this and and merge it. This will improve your code.

  1. It is better if you use a separate file for css as style.css and add link in head section of html file. It is easy to write, maintain and debug. I add a commented link in your html file for this. Just copy all that is inside of style tag and paste it in style.css file
  2. Don't use dot (.) with body.
  3. Use background-color in body.
  4. Use flex properties in body so you don't need to use width: 70vw; and height: 80vh; in .main
  5. Use rem in place of vw in .main-content for width as width: 15rem;
  6. Use main in place of <div class="main">.
  7. Change p of "Improve your front-end..." to h1. As one heading is necessary.
  8. Use 375px in place of 400px in media query.
  9. Don't use width: 70vw;, height: 80vh;, margin: auto auto; and margin-top: 60px; in main. As card is in the center and we are using flex for this.

As this is your first solution here, you learned a lot. Keep going. Keep learning.

If you need more help, please feel free to ask. : )

Good Luck.

You can check my solution of this project in GitHub if you wanted.

Marked as helpful

0

Sheetal 190

@sheetal1409

Posted

@SoniBasant Thank you . I will take a look at it and update accordingly .

0
Ecem Gokdogan 9,380

@ecemgo

Posted

Some recommendations regarding your code that could be of interest to you.

  • In order to fix the accessibility issues, you need to replace <div class="main"> with the <main> tag. :) You'd better use Semantic HTML, and you can also reach more information about it from Semantic HTML and Using Semantic HTML Tags Correctly.

  • Also, each main content needs to start with an h1 element. Your accessibility report states page should contain a level-one heading. So, you need to use a <h1> element in the <main> tag instead of using <p>. You can replace your <p class="first-p">Improve your front-end skills by building projects</p> elements with the <h1 class="first-p">Improve your front-end skills by building projects</h1> element.

Hope I am helpful. :)

Marked as helpful

0

Sheetal 190

@sheetal1409

Posted

@ecemgo Thank-you for feedback .

1

@Boyutife

Posted

Hi Mary sheetal1409👋. Job well done Congratulations on successfully completing the challenge! 🎉

I have some additional suggestions for 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. To address this issue, you can review the HTML code of the webpage and add appropriate landmarks where necessary. Some common landmarks that you may want to consider including are: <header> <main> <section> <aside> instead of multiple <div> <span> I hope you find this helpful 😄 Above all, the solution you submitted is great !

-In your html file you could replace the <div class = 'main'> with <main> tag

CSS:

-You might considering changing the px to rem. rem and em are relative units in CSS, which means that their size is determined by their relationship to other elements in the document. In contrast, px is an absolute unit, which means that its size is fixed and does not change based on any other factors.

-Overall, while there may be some cases where px is appropriate (e.g., for border widths or image sizes), using relative units like rem or em can help improve the accessibility and responsiveness of your website, as well as make it easier to maintain.

  • About the white Space, try the below code and remove the .main-content width from media query because this is more responsive, let me know if it helpful
 .main-content {
      background-color: white;
      width: 15rem;
      height: auto;
      padding: 10px;
      border-radius: 10px;
    }

Happy coding!

Marked as helpful

0

Sheetal 190

@sheetal1409

Posted

@Boyutife Thank you for the helping me . Yes I tried the solution you gave and it did work :)

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