Bkjia.com CSS documentHow can I use CSS to achieve a translucent background effect? Those who have worked on the activity page may experience the effect of translucent background. We generally use two layers, one for text and the other for transparent background, because the effect of the transparent filter will affect the content. However, if you only need to implement it in IE, we have a simpler approach:
Reference content is as follows: <Html> <Head> <Title> www.bkjia.com </title> <Style> . Alpha1 { Width: 300px; Height: 200px; Background-color: # FF0000; Filter: Alpha (Opacity = 30 ); } . Ap2 { Position: relative; } </Style> </Head> <Body> <Div class = "alpha1"> <Div class = "ap2"> <P> the background of www.bkjia.com is red (# FF0000) and the transparency is 20%. </P> </Div> </Div> </Body> </Html> |
Let's take a look at the demo. Please click to run the Code:
<Html>
Run code
Copy code
Add to favoritesBkjia.com prompts that some code can be modified before running!