Design comparison
Solution retrospective
What ist the best way to organize the rules in the CSS file? I made headings (as comments) like Typography, Layout,... Is there a best practice?
Community feedback
- @HassiaiPosted over 1 year ago
Replace<div class="card">with the main tag and <div class="attribution"> with the footer tag to fix the accessibility issues. click here for more on web-accessibility and semantic html
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.
There is no need to give the body a height value, padding and margin: 0 auto.
To center .card on the page using flexbox or grid instead of margin, add min-height:100vh; display: flex; align-items: center: justify-content: center; or min-height:100vh; display: grid place-items: center to the body.
USING FLEXBOX: body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
USING GRID: body{ min-height: 100vh; display: grid; place-items: center; }
For a responsive content give .card a fixed max-width value and a padding value for all the sides.
max-width: 320px which is 20rem and padding: 1rem which is 16px
.Give the img a max-width of 100% for a responsive image instead of width and a border-radius value.
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful0 - @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 due to
non-semantic
markup, which lack landmark for a webpage
- So fix it by replacing the element
<div class="card">
the with semantic element<main>
along with<div class="attribution">
for<footer>
a 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
I hope you find this helpful π Above all, the solution you submitted is great !
Happy coding!
Marked as helpful0 - @oduwole-ayomipoPosted over 1 year ago
You can try use variables in css! I hope this helps!
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