My first basic challenge using html and css
Design comparison
Solution retrospective
All feedback is welcome.
Community feedback
- @0xabdulkhaliqPosted almost 2 years ago
Hello there 👋. Congratulation on successfully completing your first challenge! 🎉
- I have other recommendations regarding your code that I believe will be of great interest to you.
HTML 🏷️:
- Use semantic elements such as
<main>
for<div class="container">
and<footer>
for<div class="attribution">
to improve accessibility and organization of your page.
- Always avoid skipping heading levels; Starting with
<h1>
and working your way down the heading levels (<h2>
,<h3>
, etc.) helps ensure that your document has a clear and consistent hierarchy. Source 📘
- Since this component involves scanning the QR code, the image is not a decoration, so it must have an
alt
attribute. Thealt
attribute should explain its purpose. e.g.alt="QR code to frontendmentor.io"
I hope you find it useful! 😄 Above all, the solution you submitted is great!
Happy coding!
Marked as helpful1 - @HassiaiPosted almost 2 years ago
Replace <div class="container"> with the main tag and <h3> with <h1> to fix the accessibility issues. click here for more on web-accessibility and semantic html
There is no need for the <br> in the html
To center .container on the page using flexbox only instead of flexbox and margin, add
min-height: 100vh
to the body and remove the margin values in .container.Give h1 and p the same font-size of 15px which is 0.9375rem and the same margin-left, margin-right and margin-top values. Give p a margin bottom value.
There is no need for the height value in .container. For a responsive content replace the width in .container with max-width and reduce its value.
max-width: 320px
. Give the img a max-width of 100% for a responsive width instead a width and height values.Use relative units like rem or em as unit for the padding, margin, width values and preferably rem for the font-size values, instead of using px which is an absolute unit. For more on CSS units Click here
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
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