CSS Color Filter Overlay

前端 未结 4 1880
太阳男子
太阳男子 2021-02-15 19:33

I\'m trying to create a color overlay over an image, like in this app (the green overlay over the image):

http://i.imgur.com/4XK9J6G.png

To me, it doesn\'t look

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-15 20:10

    Well this may not be what you wanted, but I got a pseudo filter over the image

    img {
      display: block;
      z-index: 1;
    }
    
    div.wrapper {
      position: relative;
      display: inline-block;
    }
    
    /* Filter */
    div.over {
      content: "";
      background: rgba(0,200,0,0.5);
      position: absolute;
      height: 100%;
      width: 100%;
      top: 0;
      left: 0;
      z-index: 2;
    }

提交回复
热议问题