That wasn't hard until give color to image was really difficult
Design comparison
Solution retrospective
Guys how can i give a color to img using html tag in my project i gived to img with content property
Community feedback
- @KristinaRadosavljevicPosted about 2 years ago
Hi there, congrats on completing the challenge :)
As for coloring the image, there's a CSS property called
background
, you can assign it to a color, image, gradient, etc. And also, this property can have multiple values, where the values will stack on top of each other. You can use this functionality to very easily add a tint to the image by overlaying it with a semi-transparentlinear-gradient
(I used this article to help me figure it out, and you can also check out my solution to see how I implemented it).There are a couple of other little things I noticed while checking out your solution:
- I don't think you should use this many
<br>
elements in your HTML. I believe the text is supposed to break naturally when using the correct layout. - Instead of using
.stats ul li:nth-child(1)
as a selector, I would personally give these elements a class name, I figure it would make the CSS code a bit cleaner (although, I guess this can be used to practice pseudo-classes, so if that was the intention, you can ignore this point) :) - You can work on making your project a bit more responsive by using things like
rem
units (or some other responsive units),max-width
, media queries, etc.
I hope this helps! :)
Marked as helpful0 - I don't think you should use this many
- @correlucasPosted about 2 years ago
👾Hello @ata58011, congratulations on your solution!
Nice code and nice solution! You did a good job here putting everything together. I’ve some suggestions for you:
To get closer to
overlay effect
on the photo as the Figma Design its better you usemix-blend-mode
. All you need is thediv
under theimage
with thisbackground-color: hsl(277, 64%, 61%);
and applymix-blend-mode: multiply
andopacity: 80%
on theimg
orpicture
selector to activate the overlay blending the image with the color of the div. See the code bellow:img { mix-blend-mode: multiply; opacity: 80%; }
✌️ I hope this helps you and happy coding!
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