菜鸟学堂
在线运行
源代码
<!DOCTYPE html> <html> <head> <style> div { background-color:red; opacity:0.5; filter:Alpha(opacity=50); /* IE8 and earlier */ } </style> </head> <body> <div>This element's opacity is 0.5! Note that both the text and the background-color are affected by the opacity level!</div> </body> </html>
运行结果
在线运行
菜鸟学堂 edu.jb51.net