[Css] Css achieves DIV translucent effect (example)

.aaa{
    filter:alpha(Opacity=80);  /*  IE有效 */
    -moz-opacity:0.5; /* 火狐浏览器有效,IE无效 */
    opacity: 0.5; /* 除IE外,所有浏览器都有效 */
} 
  1. Generally use filter and opacity
  2. 0.5 means 50%

Second, the div is transparent, but the content in the div is not transparent

background:rgba(0,0,0,0.2);

0.2 is 20% transparency

Guess you like

Origin blog.csdn.net/dxnn520/article/details/123697951