兼容IE6的纯CSS背景半透明文字不透明
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title> IE背景半透明 </title> <style type="text/css"> .alpha{ width: 100px; height: 100px; color: #fff; background: rgba(0, 0, 0, .3); filter: progid:DXImageTransform.Microsoft.gradient(gradientType = 0, startColorstr = #50000000, endColorstr = #50000000)\9; } :root .alpha{ filter: none; /*for IE9*/ } </style> </head> <body> <div class="alpha"> 文字文字 </div> </body> </html>
补充:web前端 , HTML/CSS ,