css background color overwrites text color problem

As shown in the figure, above the picture is a div with text inside

 If the div background color is set, it will override the text color, causing the text not to be displayed. Setting opacity doesn't work either.

 

 Setting color and transparency through rgb can solve the problem of background color coverage

background-color: rgb(255, 255, 255,0.3);

Note: sass does not support the writing method of rgb transparency.

Guess you like

Origin blog.csdn.net/m0_73533910/article/details/131960583