Design comparison
SolutionDesign
Community feedback
- @ecemgoPosted over 1 year ago
Some recommendations regarding your code that could be of interest to you.
HTML
In order to fix the accessibility issue:
- 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. - Each main content needs to start with an h1 element. Your accessibility report states page should contain a level-one heading. So, you need to use a
<h1>
element in the<main>
tag. You can replace your<h2>Improve your front-end skills by building projects</h2>
element with the<h1>Improve your front-end skills by building projects</h1>
element.
CSS
- If you want to center it correctly, you can use flexbox in the
body
and also you can use the recommended color for the background inbody
:
body { background-color: hsl(212, 45%, 89%); display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100vh; }
- after using flexbox in the
body
, the.container
is updated a little bit
.container { background: white; max-width: 20rem; border-radius: 20px; padding: 1.2rem; text-align: center; font-family: Arial, Helvetica, sans-serif; }
Hope I am helpful. :)
Marked as helpful0@Andigashi1Posted over 1 year ago@ecemgo thanks for the corrections and the tips will do my best to use them from now on
1 - You need to replace
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