transparent background image

后端 未结 5 1695
暗喜
暗喜 2020-12-31 04:05

I have the following css.

   #mypass{
                background-image: url(\"Images/logo.png\");
                background-attachment: fixed;
                      


        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-31 05:05

    This is the way to do it:

    div {
      width: 200px;
      height: 200px;
      display: block;
      position: relative;
    }
    
    div::after {
      content: "";
      background: url(image.jpg);
      opacity: 0.5;
      top: 0;
      left: 0;
      bottom: 0;
      right: 0;
      position: absolute;
      z-index: -1;   
    }
    

提交回复
热议问题