Design comparison
Solution retrospective
Reviews are appreciated. In this challenge I faced an issue while placing the image, so when the webpage is in mobile view the image doesn't fit the div exactly and if the screen size is further reduced the image also starts getting small. If someone can help me with this It would be great help.
Community feedback
- @AgataLiberskaPosted over 3 years ago
Hi Ananth, have you tried adding that colour overlay as background-color on the same image as the image, instead of adding another element? You can then use
background-blend-mode
to get the effect you want.But in general to get the right image size you can also just change
background-size
to cover on the div with the image :)1@AgusRezettPosted over 3 years agoWhat a job! Adding something to the Agata comment. You can play with the "filter" css prop. Just modify the contrast or brightness values and you can reach the same sample colour. Otherwise, the image should be over the overlay. You can use the img html tag allowing a more complex and useful control of the DOM and future support (and the SEO will be glad).
Good luck!
0@AnanthkumaranPosted over 3 years ago@AgataLiberska Thank you for reviewing my work, I tried the background-size to cover but nothing happened but I'll definitely try background-blend mode.
0@AnanthkumaranPosted over 3 years ago@AgusRezett Thank you for the solution, I tried it with the img html tag but when I tried to add the overlay using css the overlay was behind the image, I tried to change the position for both img and overlay but I was not able to get the required design.
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