Design comparison
Solution retrospective
How do I center the card vertically, I could not get it to work?
Community feedback
- @MelvinAguilarPosted almost 2 years ago
Hi there 👋. Good job on completing the challenge ! I have some feedback for you if you want to improve your code.
Use
min-height: 100vh
instead ofheight: 100%
to center it verticallyHTML:
- Use the
<main>
tag to wrap all the main content of the page instead of the<section class="cardm">
tag. With this semantic element you can improve the accessibility of your page.
- You must use a level-one heading (h1) even though this is not a full-page challenge. You can create an '<h1>' element within your 'main' element that will be hidden visually but visible and readable by screen readers. The class "sr-only" hides content visually and here are the styles to copy. e.g.:
<h1 class="sr-only">QR Card Component</h1>
- The
alt
attribute should explain the purpose of the image. Uppon scanning the QR code, the user will be redirected to the frontendmentor.io website, so a betteralt
attribute would beQR code to frontendmentor.io
If you want to learn more about the
alt
attribute, you can read this article.CSS:
- You should use a CSS reset to remove the default browser styles and make your page look the same in all browsers.
Popular CSS resets:
I hope you find it useful! 😄 Above all, the solution you submitted is great!
Happy coding!
1 - Use the
- @nicolasfigPosted almost 2 years ago
Hi Tom, to center the card vertically change the height value of the container to
height: 100vh
instead ofheight:100%
also you should place the attribution outside of the component inside a<footer>
, check the warnings that appeared when you submitted the solution.1 - @CodeCruzePosted almost 2 years ago
Thank you both of you guys! This was a huge help. And this is my first submission and I didn't know there would be warnings, totally missed them. Thanks!
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