<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Flash透明效果</title>
<style>
body {
font-family: Arial, sans-serif;
font-size: 14px;
margin: 0;
padding: 0;
}
.container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.flash {
position: relative;
width: 300px;
height: 200px;
background: #000;
opacity: 0.5;
color: #fff;
text-align: center;
padding: 20px;
}
.flash p {
margin: 0;
}
.flash:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: url(flash_image.jpg) no-repeat center center;
background-size: cover;
opacity: 0.5;
}
.flash:hover:before {
opacity: 1;
}
</style>
</head>
<body>
<div class="container">
<div class="flash">
<h1>Flash透明效果</h1>
<p>将鼠标悬停在Flash上面,可以看到背景图像的透明度发生变化。</p>
</div>
</div>
</body>
</html>