<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>IE半透明</title> <style> div{ width:200px; height: 200px; border:1px solid #333; background:rgba(0,0,0,0.5); filter:progid:DXImageTransform.Microsoft.gradient(startcolorstr=#7F000000,endcolorstr=#7F000000); /* ie低版本適配 7F 爲透明度的值,後面爲16進制顏色值 透明度的取值0~255 而後轉16進制 127爲半透明轉16進製爲7F */ } </style> </head> <body> <div> </div> </body> </html>