Design comparison
Community feedback
- @HassiaiPosted over 1 year ago
Replace <div class="main-card"> with the main tag and <h2> with <h1> to fix the accessibility issues. click here for more on web-accessibility and semantic html
The image of the Qr-code can be found in the images folder in the zip folder you downloaded for this challenge.
Add the alt attribute
alt=" "
to the img tag and give it a value to fix the error issue. The value of the alt attribute is the description of the image. For decorative images like icons, there is no need to give it an alt value, for more on alt attribute Click here.To center .main-card on the page using flexbox only, replace the height in the body with min-height: 100vh and add justify-content: center to the body and remove the margin value in .container.
USING FLEXBOX only: body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
for a responsive content, replace the width in .main-card with max-width, increase its padding value
padding: 16px
and remove the height value.Give the img a max-width of 100% for a responsive image and a border-radius value, the rest are not needed.
Give h1 and p the same font-size of 15px which is 0.9375rem, text-align: center, the same margin-left, margin-right and margin-top values. Give p a margin bottom value.
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@Min123123Posted over 1 year ago@Hassiai Thanks! All tips are really helpful. I'll work on it! Have a nice day!
0 - @frank-itachiPosted over 1 year ago
Hello there 👋. You did a good job!
I have some suggestions about your code that might interest you.
HTML 📄:
- Wrap the page's whole main content in the
<main>
tag. - If your code has different sections that have a specific like a , , sections or footer, it’s a good practice to enclose those parts with HTML5 landmarks.
For example, you could use a
<footer>
tag to wrap a footer section. - The heading order is important in the html structure so try to always start your headings and/or titles with an
<h1>
tag and then you can increase by one if you need to use more headings in your html code. - Make sure that the
<img>
elements in your HTML code has an alternate (descriptive text) short text. The reason for this is that screen readers can’t translate images into text. So to fix this you can do the following<img src=”…” alt=”short text” >
I hope you find it useful! 😁😁 Above all, the solution you submitted is great👌!
Happy
<coding />
😎!Marked as helpful0@Min123123Posted over 1 year ago@frank-itachi Thanks for your advice! Grateful i can get those worth tips for my result. Have a great day!
0 - Wrap the page's whole main content in the
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