Design comparison
Community feedback
- @EricodesenvolvedorPosted over 2 years ago
body { background-color: hsl(212, 45%, 89%); text-align: center; width: 100%; height: 100vh; display: flex; justify-content: center; align-items: center; margin: 0; padding: 0; }
.main-block { width: 20%; padding: 15px; background-color: white; border-radius: 15px; }
- Vai ficar um pouco mais centralizado, o seu projeto estava para o lado direito da tela ,-,
Marked as helpful0 - @Bayoumi-devPosted over 2 years ago
Hey Khushi, Congratulations on completing this challenge... You have
accessibility issues
that need to fix.Document should have one main landmark
, Contain the component with<main>
.
<main> <div class="main-block"> //... </div> </main>
-
Page should contain a level-one heading
, Change<div class="body-block">
to<h1 class="body-block">
You should always have oneh1
per page of the document... in this challenge, you will useh1
just to avoid theaccessibility issue
that appears in the challenge report... but don't useh1
on small components<h1>
should represent the main heading for the whole page, and for the best practice use only one<h1>
per page. There are six levels of section headings<h1>
to<h6>
-
This
<div class="body-block1">Scan the QR code to visit Frontend Mentor and take your coding skills to the next level </div>
describes the card, So you should use the paragraph element<p>
instead of<div>
. -
I suggest you center the component on the page with
Flexbox
, by giving the parent element<main>
the following properties:
body { background-color: hsl(212, 45%, 89%); /* text-align: center; <---Remove */ /* width: 90rem; <---Remove */ } main { /* <---- Add */ display: flex; justify-content: center; align-items: center; min-height: 100vh; } .main-block { width: 300px; /* <---- Changed */ padding: 15px; text-align: center; /* <---- Add */ background-color: white; border-radius: 15px; /* display: inline-block; <---Remove */ /* position: absolute; <---Remove */ /* top:25%; <---Remove */ }
Hope this help!... Keep coding👍
Marked as helpful0@khushi-2002Posted over 2 years ago@Bayoumi-dev Thankyou so much, I'll update my solution
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