Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

css gradient opacity slide image left to right color white

Tags:

html

css

I want to use css, to fill a certain color on my image, it will have a blur reduction. enter image description here

I tried many ways but colors can not be inserted on the image. Please tell me the parameters so that I can adjust the width or height, or the opacity, change the color.

like image 876
Tran Audi Avatar asked Dec 02 '22 12:12

Tran Audi


1 Answers

You can use pseudoelement afterto position the color above the image as this:

div, img {width:100%;}
div {position:relative;}
div:after {
  width:100%;
  content:'';
  display:block;
  position:absolute;
  top:0;
  left:0;
  background: linear-gradient(to right, rgba(247,247,49,1) 0%,rgba(255,255,255,0) 69%);
  height:100%;
}
<div>
  <img src="http://img.andrewprokos.com/TORONTO-PANORAMIC-SKYLINE-DUSK-1200PX.jpg" alt="">
</div>
like image 69
Alvaro Menéndez Avatar answered May 04 '23 11:05

Alvaro Menéndez