Hey. Tell me what to do. The task is standard: there is a background image, it is necessary to impose a darkening of a certain color and transparency on it. It is superimposed. But the problem is that it changes the color of the text. How to solve?

.wrapper { position: relative; } .wrapper::before { content: ""; position: absolute; top: 0; left: 0; height: 100%; width: 100%; background-color: #00A5BB; opacity: 0.7; } 
 <div class="wrapper"> Всем привет </div> 

    1 answer 1

     .wrapper { position: relative; } .wrapper::before { content: ""; position: absolute; top: 0; left: 0; height: 100%; width: 100%; background-color: #00A5BB; opacity: 0.7; z-index: -1; } 
     <div class="wrapper"> Всем привет </div> 

    • Well, fast) did not have time!) - kizoso Nov.
    • Thank you!) It's all just how) - PolonskiyP
    • there is a button for a quick answer - Copy code in response - soledar10
    • Why not use rgba instead of opacity? - Ruslan Semenov
    • @Ruslan Semenov - in this case, no matter what option to use - soledar10