Tran Audi Tran Audi - 3 years ago 303
CSS Question

css gradient opacity slide image left to right color white

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.

Answer Source

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>

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download