Design comparison
SolutionDesign
Solution retrospective
Is there a way to add a color overlay to a grayscale image without adding another DOM element?
Community feedback
- @Bayoumi-devPosted over 2 years ago
Hey! It looks good!... Here are some suggestions:
- An easy way to color the image... First, Delete this element --->
<div id="imageHeaderOverlay"></div>
, then give the wrapper of the image(#imageSection
)background color
toblend
it with the image:
#imageSection { position: relative; background-color: var(--accent); /* <---- Add */ } #imageHeader { /* filter: contrast(0.7); /* <---- Remove */ mix-blend-mode: multiply; /* <---- Add */ opacity: 75%; /* <---- Add */ } /* #imageHeaderOverlay { /* <---- Remove all */ width: 100%; height: 100%; position: absolute; top: 0px; left: 0px; background-color: hsla(283, 74%, 53%, 0.63); mix-blend-mode: multiply; } */
- Put the status of the preview card component into the
list item
to add moresemantics
to your project,Div
's don't do much for semantics but a list is much more meaningful..:
<ul class="stats-preview__stats"> <li> <span class="stat-number">10K+</span> <span class="stat-name">Companies</span> </li> <li> <span class="stat-number">314</span> <span class="stat-name">Templates</span> </li> <li> <span class="stat-number">12M+</span> <span class="stat-name">Queries</span> </li> </ul>
Hope this help!... Keep coding👍
Marked as helpful0 - An easy way to color the image... First, Delete this element --->
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