Design comparison
Solution retrospective
The card is simple and doesn't take a lot of time to do. The only question I have is the hover effect of the image. The view icon and cyan background has different opacity. What I did is that I used two pseudo-elements, but is it possible to do just with one, considering I am using css variables, so the use of hsla
is not an option?
Community feedback
- @john-miragePosted over 1 year ago
Hello,
I dont really understand your question, but i can say that you can have a background image and a background-color on the same element, you center the image and yes you use a transparent color with hsla or rgba css function so no need of opacity in this one.
0@skyrimerPosted over 1 year ago@john-mirage, the hover effect on image consists of two parts: semitransparent cyan mask on top of the image and the view icon on top of everything. What I did, was using
::before
for the mask and::after
for the icon, which change theiropacity
when the mouse is over the image. My question was whether it is possible to unit the mask and the image into one element. If yes, then how?0@skyrimerPosted over 1 year ago@john-mirage, yes, but if you look back at the challenge. We need to see the content inside the div. In your case (in the codepen), the
background-color
is not half transparent.0@john-miragePosted over 1 year ago@skyrimer yes, my bad, i forgot the background color, i fixed the solution :)
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