QR Code Component Webpage using HTML, CSS & GRID
Design comparison
Community feedback
- @NehalSahu8055Posted over 1 year ago
Hello Coder ๐.
Congratulations on successfully completing the challenge! ๐
Few suggestions regarding design.
โจRemove
width:1440px
frombody
as this is unnecessary to add in this design.โจRemove
margins
from.card
as this will not dynamically center the card.โจTo properly center the container.
- USING FLEXBOX
body{ min-height: 100vh; display: flex; align-items: center; justify-content: center; }
- USING GRID
body{ min-height: 100vh; display: grid; place-items: center; }
โจ Use
Semantics
for the proper design of your code.<body> <header> <nav>...</nav> </header> <main>...</main> <footer>...</footer> </body>
-
Every site must have one
h1 element
describing the main content of the page. -
So, Add a
level-one heading
instead ofp
toimprove accessibility
. -
<h1 class="head">Improve your front-end skills by building projects</h1>
-
For
non-decorative images
give meaningful and descriptive alt likealt= "QR code to Frontend Mentor website"
. -
Use
responsive units(rem, em, %)
from next project. Explore respective use cases on google.
link.
I hope you find this helpful.
Happy coding๐
Marked as helpful0 - @0xabdulkhaliqPosted over 1 year ago
Hello there ๐. Congratulations on successfully completing the challenge! ๐
- I have other recommendations regarding your code that I believe will be of great interest to you.
CSS ๐จ:
- Looks like the component has not been centered properly. So let me explain, How you can easily center the component without using
margin
orpadding
.
- We don't need to use
margin
andpadding
to center the component both horizontally & vertically. Because usingmargin
orpadding
will not dynamical centers our component at all states
- To properly center the component in the page, you should use
Flexbox
orGrid
layout. You can read more about centering in CSS here ๐.
- For this demonstration we use css
Grid
to center the component.
body { min-height: 100vh; display: grid; place-items: center; }
- Now remove these styles, after removing you can able to see the changes
.card { margin: 100px auto; }
- Now your component has been properly centered
.
I hope you find this helpful ๐ Above all, the solution you submitted is great !
Happy coding!
0 - @MelakuAlehegnPosted over 1 year ago
congratulations @eniolaade02 for finishing your first challenge. I have a few feedbacks for you in order to keep you card responsive, you can add this css to center your card on the center of the page,
.card { width: 400px; text-align: center; position:absolute; top:50%; left:50%; transform: translate(-50%, -50%); background-color:white; padding:13px; }
this will set the position of your card into the center and keep it there whenever the screen size decreases. Apart from that your design looks elegant
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