Design comparison
Solution retrospective
- Yes, I found it difficult to make the card in the middle.
- Card code about padding and space.
- For right now , I don't have a question.
Community feedback
- @correlucasPosted about 2 years ago
👾Hi @kaptenEscanor, 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:
Use
<main>
instead of a simple<div>
this way you improve the semantics and accessibility showing which is the main block of content on this page. Remember that every page should have a<main>
block and that<div>
doesn't have any semantic meaning.The main heading has the tag
<h5>
, in this case, you should replace it with<h1>
since this heading is the main title on this page. Remember that every page should have one<h1>
to declare which is the most important title and that you should follow the hierarchy using the heading sequence(h1, h2, h3, h4, h5)
and never jump a level.Clean your code by removing some unnecessary divs, most of the content can stand alone without a div. Use div only for blocks that need a special alignment or the content needs a special positioning.
Add a margin of around
margin: 20px
to avoid the card touching the screen edges while it scales down.Use relative units as
rem
orem
instead ofpx
to improve your performance by resizing fonts between different screens and devices. These units are better to make your website more accessible. REM does not just apply to font size, but to all sizes as well.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 helpful1@aliefardiansyahPosted about 2 years ago@correlucas Thank you very much for your feedback and your advice.I will try to do what you suggest.
0 - @Faris-ThibaniPosted about 2 years ago
Hey congrats on completing the project! Here is a tip to center items in the middle. 1) create a wrap for the content and set the display as flex... e.g <div style=" display:flex"> then justify-content center and align-self the child of the wrap, flex-item or the main container to center. Hope this helps. if you want more feedback and support let me know!
1@aliefardiansyahPosted about 2 years ago@Faris-Thibani I thank you for your feedback. If you don't mind, I hope to get more feedback.
1 - @Faris-ThibaniPosted about 2 years ago
@kaptenEscanor Ofcourse.. CSS flexbox is a great way to center items.. it allows you to align items based on the flex-direction or the direction of the main axis and the cross axis. For example, it's useful for navigation bars to space the items accordingly.. if you are interested to learn flex-box checkout this short course by Wes Bos: https://flexbox.io/ I'm currently learning flexbox and i think you'll find it very useful to explain all the CSS flexbox properties and get some practice with them.
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