代码:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> div{ width: 400px; height: 200px; text-align: center; line-height: 200px; background-color: yellow; /* 完全透明 0~1 完全不透明 */ opacity: 0.4; } </style> </head> <body> <div>晚上好,吴彦祖</div> </body> </html>
效果图:
CSS3-案例-元素整体透明度
最新推荐文章于 2024-10-15 16:13:44 发布