Design comparison
Community feedback
- @MelvinAguilarPosted almost 2 years ago
Hello there π. Good job on completing the challenge !
I have other suggestions about your code that might interest you.
HTML π:
- Wrap the page's whole main content in the
<main>
tag.
- The <br> tag is often used to create line breaks, but it doesn't convey any semantic meaning. When a screen-reader reads the text, it will break the flow of reading at the line break tag, which can be confusing for users. More information here.
- The <div> tag defines a division or section on a website. It is used to style a container with CSS, set special alignment, or position content.It might be more efficient to use the <p> tag; the <p> element represents paragraph-level content, usually text.
Alt text π·:
- The
alt
attribute should not contain underscores or hyphens, it must be human readable and understandable.
- The
alt
attribute should not contain the words "image", "photo", or "picture", because the image tag already conveys that information.
-
The
alt
attribute should explain the purpose of the image. Uppon scanning the QR code, the user will be redirected to the frontendmentor.io website, so a betteralt
attribute would beQR code to frontendmentor.io
If you want to learn more about the
alt
attribute, you can read this article. π.
I hope you find it useful! π Above all, the solution you submitted is great!
Happy coding!
Marked as helpful0 - Wrap the page's whole main content in the
- @HassiaiPosted almost 2 years ago
Replace <div class="main-container"> with the main tag, <div class="upper-text"> with <h1> and <div class="bottom-text"> with <p> to fix the accessibility issues. click here for more on web-accessibility and semantic html
There is no need to give the body a width value.
To center .main-container 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-container on the page using flexbox: body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
To center .main-container on the page using grid: body{ min-height: 100vh; display: grid; place-items: center; }
There is no need to give .main container a margin value and a height value . Give the img a max-width of 100% instead of a width.
Give h1 the same font-size as p.
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 helpful0
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