T
T
TitNIk2017-04-18 19:04:37
css
TitNIk, 2017-04-18 19:04:37

How to make a translucent gradient over an image?

Hello. There is a background image inserted not through css. I want to make a transparent gradient at the bottom of the image (as with a mask in Photoshop), I googled, I saw a lot of options, filters (css, svg), masks, gradients, etc., but something didn’t work out. Can anyone suggest something useful? )

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Philipp, 2017-04-18
@zoonman

https://codepen.io/alexcarpenter/pen/LveDx

S
Stalker_RED, 2017-04-18
@Stalker_RED

So? jsfiddle.net/4uvgu3sh/2
What exactly doesn't work for you?

T
TitNIk, 2017-04-18
@TitNIk

Yes, but I do not insert images through bg.

<div class="header-bg-img">
  <img src="images/img.jpg" alt="">
</div>

I set a linear gradient for the header-bg-img, and for the image I set transparency, it seems to work somehow, but the border between the image and the background is still visible from below. Maybe you can somehow move the gradient a little higher? ))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question