How do I apply an orange blur effect to a div that is encapsulating my image? I don’t want to apply anything to the image, just to its background div
<div class="image-container">
<img class="image" src="/assets/images/person.png" />
</div>
I’m expecting something similar to this, a slight orange effect all around
2
Answers
You can use a
linear-gradient
for the background of the container of the image. You’ll need to make sure that the image only shows the subject, & has a transparent background, otherwise the gradient won’t show because it’ll be layered under the image.Here’s an example I created: Image & gradient background
This is the gradient that I used:
background: radial-gradient(circle, rgba(255,165,0,1) 0%, rgba(255,255,255,1) 100%)
There are many sites that generate gradients for you. I used this one: cssgradient.io
I hope to understand properly.
To do this, we use
gradient
that have 4 types:In this code I used
linear gradient
.If you have a little trouble making it, use the
gradient Online tools
to start and play with them a little.I hope you have answered your question and got it.