Design comparison
Community feedback
- @0xabdulkhaliqPosted over 1 year ago
Hello there 👋. Congratulations on successfully completing the challenge! 🎉
- I have other recommendations regarding your code that I believe will be of great interest to you.
HTML 🏷️:
- This solution generates accessibility error reports, "All page content should be contained by landmarks" is due to
non-semantic
markup, which causes lacking of landmark for a webpage
- So fix it by replacing the
<div class="card-body">
element with the semantic element<main>
in yourindex.html
file to improve accessibility and organization of your page.
- What is meant by landmark ?, They used to define major sections of your page instead of relying on generic elements like
<div>
or<span>
. They are use to provide a more precise detail of the structure of our webpage to the browser or screen readers
- For example:
- The
<main>
element should include all content directly related to the page's main idea, so there should only be one per page - The
<footer>
typically contains information about the author of the section, copyright data or links to related documents.
- The
HEADINGS ⚠️:
- This solution has also generated accessibility error report due to lack of level-one heading
<h1>
- Every site must want at least one
h1
element identifying and describing the main content of the page.
- An
h1
heading provides an important navigation point for users of assistive technologies, allowing them to easily find the main content of the page.
- So we want to add a level-one heading to improve accessibility by reading aloud the heading by screen readers, you can achieve this by adding a
sr-only
class to hide it from visual users (it will be useful for visually impaired users).
.
I hope you find this helpful 😄 Above all, the solution you submitted is great !
Happy coding!
0 - @HassiaiPosted over 1 year ago
Replace <div class="card-body"> with the main tag and <h2> with <h1> to fix the accessibility issues. click here for more on web-accessibility and semantic html
Give thhe alt attribute in the img a value. 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.
Every html must have <h1> to make it accessible. Always begin the heading of the html with <h1> tag wrap the sub-heading of <h1> in <h2> tag, wrap the sub-heading of <h2> in <h3> this continues until <h6>, never skip a level of a heading.
Give .text a margin value for all the sides, text-align: center and a font-size of 15px which is 0.9375rem, this will be the font-size of both p and h1. Give p a margin-top or h1 a margin-bottom value for the space between the text.
For a responsive content,
- Replace thw width in .card-body with max-width value and the height with a padding value for all the sides
padding:16px which is 1rem/em
- Give the img a max-width of 100% and a border-radius value, the rest are not needed.
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
0 - Replace thw width in .card-body with max-width value and the height with a padding value for all the sides
- @khushi0909Posted over 1 year ago
I also just started the journey and submitted the challenge few hours before and What i have learnt are as follows-
1)use min-height in body as 100 vh instead of height -you can see explanation by @abdul Khalid in my solution is as follows I have some recommendations regarding your question "what happens by putting min-height?" that I believe will be of great interest to you. MIN-HEIGHT 📐:
We want to use min-height: 100vh for body instead of height: 100vh. Because setting the height: 100vh may result in the component being cut off on smaller screens, such as a mobile phone in landscape orientation. For example; if we set height: 100vh then the body will have 100vh height no matter what. Even if the content spans more than 100vh. But if we set min-height: 100vh then the body will start at 100vh, if the content pushes the body beyond 100vh it will continue growing. However if you have content that takes less than 100vh it will still take 100vh in space. !
2)use <footer> for the following line- Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>. Coded by <a href="https://github.com/ddddddd" target="_blank">dddddd</a>. and you can also reach more information about it from Using Semantic HTML Tags Correctly
3)Also there needs to be on h1 in the index.html for seo purpose it helps ,so including that instead of jumping directly to h2 may help https://www.semrush.com/blog/h1-tag/ 4) You need to replace <div class="container"> with the <main class="container"> tag. You'd better use Semantic HTML, and you can also reach more information about it from Using Semantic HTML Tags Correctly.
4)always mention alt ="description of image ",you can read about it ,why its necessary for accessibility
Everything else seems great keep going ...All the Best
0
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