Design comparison
Solution retrospective
I would like a review for this solution regarding semantic HTML and accessibility and also CSS best practices
Community feedback
- @sarahdialmeidaPosted over 3 years ago
Great work, Randy!
Marked as helpful1 - @grace-snowPosted over 3 years ago
I think you should focus some learning on when to use paddings vs margin. The way you're adding these to each element is creating a lot of work for yourself. The card body only needs some padding. Then elements within it can have vertical margin. That's much simpler than adding bespoke padding and margin on every element
Marked as helpful1 - @afrusselPosted over 3 years ago
Nice work.
Marked as helpful1 - @palgrammingPosted over 3 years ago
You should take the background off your main tag and put it on the
body
tag and then change the background size fromcover
tobackground-size: 100vw 40vw;
Marked as helpful1@RandyKdevPosted over 3 years ago@palgramming Ok thanks, @Patrick.
I already have a
background-color
on my body, can I have bothbackground-color
andbackground-image
property on one tag?Also, please could you explain the need for
background-size: 100vw 40vw;
0@palgrammingPosted over 3 years ago@RandyKdev background color does not effect background image but the image stacks on top of the background color. You can also have multiple images https://www.w3schools.com/Css/css3_backgrounds.asp
The 100vw makes the image stretch across the browser from the left to the right and the 40vh keep the image 40% of the height of the browser window
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