要使用CSS创建透明框,您可以尝试运行以下代码
<!DOCTYPE html> <html> <head> <style> div { background-color: #808000; padding: 20px; } div.myopacity { opacity: 0.4; filter: alpha(opacity=80); } </style> </head> <body> <h1>Heading</h1> <p>Check trensparency in the below box:</p> <div class = "myopacity"> <p>opacity 0.4</p> </div> <div> <p>opacity 1</p> </div> </body> </html>