Background image transparency with CSS3?

后端 未结 8 2278
生来不讨喜
生来不讨喜 2020-12-29 06:41

Is there a way to add transparency to a background-image using CSS3?

8条回答
  •  不知归路
    2020-12-29 07:27

    Add the image to the HTML tag and add a background-color using rgba(0,0,0,[your opacity])

    html {
        background:url('image.jpg') #303030; 
        background-size:cover;
    }
    
    body {
        background:rgba(0,0,0,0.7);
    }
    

提交回复
热议问题