Design comparison
Solution retrospective
Hi, everyone. I just finished building this card component. I had some challenges and I'd appreciate any solutions you guys might have. I struggled with getting the image's color to be the proper soft violet hsl color, that was given to us. I also struggled with centering my card, on the y-axis(equal margins for top and bottom spacing).
Community feedback
- @SalahShadoudPosted over 1 year ago
hey! Nice Work There just wanted to leave some notes about things i would do differently:
-
for the
main-container
you don't need to set margins to align it to the center, instead you can use thealign-items: center
property on the father conatiner --main content
div in your case -- because margins is not a great way to align things. -
for spacing inside containers and between elements, i think setting
padding
for the whole container andgap
between elements when using flexbox is a better way, because its easier to adjust than having severalpaddings
andmargins
to work with. -
i encourage you to learn about CSS RESETS before starting any challenge, it will get rid of all elements default behaviors, and i will leave this link for you if you wanna learn more about this subject CSS Resets.
Happy Coding
Marked as helpful1 -
- @AkoToSiJeromeEhPosted over 1 year ago
Hi! Great Work Out There , I just want to share how I achieve the color overlay of an image to match the design reference. using the CSS property mix-blend-mode: multiply, and it worked well for you. Additionally, for smaller screens with a width of 375px, I noticed a slight gap in the image. To address this issue, I recommended using the CSS property vertical-align: middle.(the bold text is the code i modify in your source code)
That's all I hope this suggestion helps and works . happy coding !
.image-header {
max-width: 100%;
/* -webkit-filter: opacity(0.25) drop-shadow(0 0 0 hsl(277, 64%, 61%)); */
mix-blend-mode: multiply;
opacity: 0.8;you can adjust this
vertical-align: middle;
}
.image-container {
grid-row: 1/2;
background-color: blueviolet;you can change this;
}
Marked as helpful1
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