透明盒中的文本
实例代码:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style>
.background{
display:flex;
justify-content:center;
align-items:center;
background:url(img/flower06.jpeg) repeat;
width:660px;
border:2px solid black;
height:220px;
}
.opacity{
display:flex;
justify-content:center;
align-items:center;
border:1px solid black;
background-color:#ffffff;
opacity:0.5;
height:100px;
width:500px;
}
p{
font-size:10px;
}
</style>
</head>
<body>
<div class="background">
<div class="opacity">
<p>这段文本被放置在一个透明框中。</p>
</div>
</div>
</body>
</html>
运行效果:
评论