Simple qr-code-component project made with HTML5 and CSS3
Design comparison
Solution retrospective
How to provide correct box shadow for the card in the middle?
I couldn't choose correct color for box-shadow for #card
element between hsl(212, 45%, 89%)
and hsl(220, 15%, 55%)
. And also have inaccurate offset values.
Please suggest whether the card is in proper vertical position or not? As I only used margins, and didn't use something like flexbox or positions. Thanks...
Community feedback
- @correlucasPosted about 2 years ago
👾Hi Aayush Kumar, congratulations on your solution!👋 Welcome to the Frontend Mentor Coding Community!
Great solution and a great start! From what I saw you’re on the right track. I’ve few suggestions for you that you can consider adding to your code:
1.The correct value for this shadow is
box-shadow: 5px 5px 15px 5px rgb(0 0 0 / 3%);
If you’re not familiar to box-shadow you can use this site to create the shadow design and then just drop the code into the CSS: https://html-css-js.com/css/generator/box-shadow/2.Replace the
<h3>
containing the main title with<h1>
note that this title is the main heading for this page and every page needs one h1 to show which is the most important heading. Use the sequence h1 h2 h3 h4 h5 to show the hierarchy of your titles in the level of importance, never jump a level.3.Fix the alignment. The best way make this alignment is by using
FLEXBOX
. The first step, is to addmin-height: 100vh
to make the body height size becomes 100% of the viewport height, this way you make sure the container will be aligned vertically since thebody
will display ever 100% of the screen height. After that add two flex properties to make the alignmentdisplay: flex
/align-items: center;
/justify-content: center;
. If you're using the attribution you need to addflex-direction: column
to make the attribution stays under the QR Code component. See the code below:body { min-height: 100vh; margin: 0; padding: 0; background-color: hsl(212, 45%, 89%); display: flex; align-items: center; justify-content: center; }
Here's my solution for this challenge if you wants to see how I build it: https://www.frontendmentor.io/solutions/qr-code-component-vanilla-cs-js-darklight-mode-nS2aOYYsJR
✌️ I hope this helps you and happy coding!
Marked as helpful2@AK-CHP1Posted about 2 years ago@correlucas Thanks for providing the feedback. I will fix this
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