Design comparison
Solution retrospective
Here is my second solution here on Frontend Mentor, I would really appreciate reviews and answers to the questions below
-
What is the best or more preferable way of overlaying the color on the image?
-
Currently, I have used an empty
div
and put the image as abackground-image
of thediv
, then used the pseudo-element,after
to put a semi-transparent element with the desired color. Is this best practice? -
And also, I tried using the pseudo-element,
after
of animg
tag, but it seemed to be absent. Doimg
tags not have pseudo-elements or is it covered by the image? i tried altering thez-index
to no avail -
How can an image be clipped from a parent element? for example, If an image is in a
div
, setting theborder-radius
on thediv
should also clip the image.
Thanks, I would really appreciate any answers or clues or pointers that can be given 😁.
Community feedback
- @ChamuMutezvaPosted over 3 years ago
i might be able to answer one or two of your questions.
- for the overlay , see the following article on blend modes
- an image does not have a pseudo element as it is considered an empty element. Elements that do not have a closing tag. Elements in the following format will have pseudo elements
<element>blala</element>
Marked as helpful1@RandyKdevPosted over 3 years ago@ChamuMutezva Thanks for the answers.
I am just hearing of blend modes now, I will check it out.
Ohh, it means
br
tags too don't have pseudo-elements.Thanks for that insight.
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