Design comparison
Solution retrospective
Do you think the structure and design are good? What would you improve about my code?
All feedbacks and suggestions are welcome !!
Community feedback
- @purnimakumarrPosted over 2 years ago
Hi Joao,
I would suggest these changes:
-
There is 1 accessibility issue. You can remove that by replacing the
<h2></h2>
tag with an<h1></h1>
tag. It is a good practice to put the first heading of your site in an<h1></h1>
tag. It makes your site more accessible. -
Also, I would suggest to put the
<footer></footer>
outside of the<main></main>
. Footer is not a part of the main content of the website. So, your code would look something like this:-
<body> <main> main content goes here... </main> <footer> attribution goes here... </footer> </body>
-
And I see you are using a
<div></div>
tag for the QR code image. The issue is that it makes the code hard to read as one cannot know what thediv
is for unless they observe the CSS file, and also it is not an accessible option because screen readers see this as just an emptydiv
and therefore, people using screen readers can't know that there is a QR code image there. The fix for this would be to userole
andaria-label
attributes.<div role="img" aria-label="A QR code to frontendmentor.io"></div>
Therole="img"
specifies that thediv
is being used to render an image andaria-label
attribute works as alt-text for the image in this case. -
Lastly, you can put the CSS in the index.html file in the CSS file. It is good practice to put all the styles in a seperate CSS file.
Marked as helpful1 -
Please log in to post a comment
Log in with GitHubJoin 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