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.
ESSENTIALS ♻️:
- This solution has generated accessibility error reports due to lack of
lang
attribute inside ofhtml
element
<html>
element must have a lang attribute with valid value, so fix it by updating like this<html lang="en">
HTML 🏷️:
- This solution generates accessibility error reports, "All page content should be contained by landmarks" is due to
non-semantic
markup, which lack landmark for a webpage
- So fix it by replacing the
<div class="container">
element with the semantic element<main>
element 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 convey the structure of your page. 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
HEADINGS ⚠️:
- And, 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!
Marked as helpful0 - @HassiaiPosted over 1 year ago
Replace <div class="container"> with the main tag and <h2> with <h1> to fix the accessibility issues. click here for more on web-accessibility and semantic html
Add the language attribute to the html tag
<html lang = "en">
to fix the error issue. There is no need for the <br> in the html.To center .container on the page using flexbox, replace the height in the body with min-height: 100vh.
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.
Replace the height in .container with a padding value for all the sides, this will prevent the content from overflowing on smaller screens and its a responsive replacement.
padding: 16px
For a responsive content, replace the width in .container with max-width and give the img a max-width of 100% and a border-radius value, the rest are not needed.
There is no need to give .container a margin 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 - @tobezhanabiPosted over 1 year ago
Hi Abdul, You did a nice job. Congratulation on submitting a working task. 🎉🎉
Here are a few suggestions to the issue with your solution.
Work on HTML
You should replace the <div class="container"> with the landmark <main> this way your site gets accessibility. It is not important for this fragment of a site, but by making it in a habit, you can easily build crawl-able site. Landmarks in HTML are structural elements that define the major sections of a webpage. They include semantic elements such as <header>, <nav>, <main>, <article>, <aside>, and <footer>
Heading
Generally, it is a best practice to ensure that the beginning of a page's main content starts with a h1 element, and also to ensure that the page contains only one h1 element.
You should always have h1 tag on your site, and they should follow the hierarchical order. i.e. h1> h2> h3 till h6
Overall, you did a fantastic job,
happy coding
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