How to set opacity for bg-image in CSS without affecting the Context in the page.
            Asked
            
        
        
            Active
            
        
            Viewed 45 times
        
    1 Answers
0
            
            
        div {
  width: 300px;
  height: 200px;
  background: linear-gradient(rgba(80,80,80,.5), rgba(80,80,80,.5)), url("https://www.techeshta.com/wp-content/uploads/2020/12/Yagnik-Padaliya.jpg");
}
span {
  background: black;
  color: white;
}<div>
  <span>Hello world.</span>
</div> 
    
    
        YAGNIK PADALIYA
        
- 1
- 4
