Design comparison
Solution retrospective
any criticism would be appreciated..... new to front end development and realized the only way to start to get better, is to START!!!
Community feedback
- @vanzasetiaPosted over 3 years ago
👋Hi Ray-Xavier-2021! My name is Vanza!
I would recommend to use
background-blend-mode
for purple overlay, which is much easier in my opinion for this kinda stuff:- HTML
<div class="img-container"> </div>
- CSS
.img-container { background-image: url(../images/image-header-mobile.jpg); width: 100%; background-position: center; background-size: cover; background-repeat: no-repeat; background-color: hsl(277, 64%, 61%); background-blend-mode: multiply; }
This way, you don't need child element on your
img-container
.That's it! Hopefully this is helpful!
0 - @FarisPalayiPosted over 3 years ago
Good job👍 site is responding well. In addition to what @Paisley said, you can also use the css
filter
property on image. Or, you can create an overlay on top of the image with propercolor
andopacity
.0@Ray-Xavier-2021Posted over 3 years ago@FarisPalayi not to sure on how to apply the method you're advising
1@FarisPalayiPosted over 3 years ago@Ray-Xavier-2021
- If you want to use
filter
, then I suggest you to learn about filters since working with them can be a bit tricky. Here's an article from css-tricks - The second method - Create a div or span with the same height and width of the image. And position it absolutely by using
position: absolute
and set it to relative to parent(image container div) by adding it aposition: relative
. And then you can giveheight
andwidth
100% to get the same height and width of the image container. Then give the new created element abackground-color
(for eg: purple) and give it some opacity like thisopacity: .8
. Instead of using a div or span you can also use css pseudo-elements like::before
or::after
if you are familiar with them. And play with the background-color until you find a good match.
And if you are just starting out, I suggest you to move on with this project and, once you learnt about these stuff, you can change it then.
0 - If you want to use
- @simpsonpaisleyPosted over 3 years ago
Looking great! You can make the purple overlay on the image using the mix-blend-mode property, and adding a container with a purple background colour around the image element.
0@Ray-Xavier-2021Posted over 3 years ago@simpsonpaisley thank will try thaty out never learned that .....greatly appreciated
0@Ray-Xavier-2021Posted over 3 years ago@simpsonpaisley i tried your method but it broke the image for the desktop layout
1@simpsonpaisleyPosted over 3 years ago@Ray-Xavier-2021 Hi, sorry about that. Did you make the div display property block? If not, that might help.
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