This is a simple QR code component created with HTML & CSS
Design comparison
Solution retrospective
I would love, if i could get a solution to making text sit right after each other apart from using padding. thanks
Community feedback
- @MelvinAguilarPosted almost 2 years ago
Hello there ๐. Good job on completing the challenge !
I have some suggestions about your code that might interest you.
HTML ๐:
- Use the
<main>
tag to wrap all the main content of the page instead of the<div>
tag. With this semantic element you can improve the accessibility of your page.
- Use the
<footer>
tag to wrap the footer of the page instead of the<div class="attribution">
. The<footer>
element contains information about the author of the page, the copyright, and other legal information.
- Always avoid skipping heading levels; Always start from
<h1>
, followed by<h2>
, and so on up to <h6> (<h1>,<h2>,...,<h6>).
- 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.QR code to frontendmentor.io
I hope you find it useful! ๐
Happy coding!
Marked as helpful2 - Use the
- @HassiaiPosted almost 2 years ago
Replace<div id="main-page">with the main tag, <h3> with <h1> and <div class="attribution"> with the footer tag to fix the accessibility issues. click here for more on web-accessibility and semantic html
To center # main-page on the page, add min-height:100vh; display: flex; align-items: center: justify-content: center; or min-height:100vh; display: grid place-items: center to the body.
To center #main-page on the page using flexbox: body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
To center #main-page on the page using grid: body{ min-height: 100vh; display: grid; place-items: center; }
The body has a wrong background-color. Use the colors that were given in the styleguide.md found in the zip folder you downloaded.
replace the height in #main-page with a padding value for all the sides.
padding: 15px
. There is no need to style .image-container, give the img a max-width of 100% insteade of a width value.Give h1 and p the same font size of 15px. 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