Design comparison
Solution retrospective
adding another layer of color bg on image was something which I don't like, would try any other method next time!
What challenges did you encounter, and how did you overcome them?My screen size is comaratively greater than 2xl and I have to make it responsive accorging to the lg size, I always need to do it responsive for 3 devices,!
Community feedback
- @0xabdulkhaliqPosted 8 months ago
Hello there 👋. Congratulations on successfully completing the challenge! 🎉
- I have a suggestion regarding your doubt that I believe will be of great interest to you.
- Currently you're adding a
div
on top ofimg
to replicate your solution as per the design with Purple overlay.
- This is how you implemented it right now,
<div class="relative block lg:hidden"> <img src="/assets/image-header-mobile-fYqb8l1J.jpg" alt="desk" class="w-full rounded-t-lg" /> <div class="absolute top-0 left-0 w-full h-full rounded-r-lg bg-[hsl(277,64%,61%)] opacity-40"></div> </div>
- Instead of using an empty div to create an purple overlay, we can just use a css property called
mix-blend-mode
for theimg
element, and want to apply the purple background color for the container which wraps theimg
element.
- For Example:
<div style="" class="relative block bg-[hsl(277,64%,61%)] lg:hidden"> <img src="/assets/image-header-mobile-fYqb8l1J.jpg" alt="desk" class="w-full rounded-t-lg mix-blend-multiply opacity-75" /> </div>
- Here we have applied the background color for
img
parent element and forimg
we have addedmix-blend-multiply
to multiply the bg color andopacity-75
for giving a.75
opacity toimg
so that it would look like exact replicate of design image.
.
I hope you find this helpful 😄 Above all, the solution you submitted is great !
Happy coding!
0@tusharshah21Posted 8 months agodamn! I really forget about it, thanks for letting me know would implement it in this in some time! Thanks a lot man @0xabdulkhalid
0 - @shukhratgithubPosted 8 months ago
in mobiles, there is margin around the card. check out one more time! You can just remove the margin or the padding around the component and it will be user-friendly! It looks a little ugly when I open it on my 13 pro. Thank you!
0@tusharshah21Posted 8 months ago@shukhratgithub
alright noted that! Would update this till the end of the day and would keep this in mind from the next time
thanks for the feedback and letting me know!!
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