先来看看效果
image.png
代码在此,简单直观
<!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>
* {
margin: 0;
padding: 0;
}
body,html {
height: 100%;
background:url('./images/2220bfc21dded1378729809b2eb5e926.jpg')no-repeat center;
background-size: cover;
position: relative;
}
.dialog {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
width: 920px;
height: 500px;
color: #fff;
font-size: 38px;
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
border-radius: 8px;
background: rgba(255, 255, 255, .3);
box-shadow: 3px 3px 6px 3px rgba(0, 0, 0, .3);
overflow: hidden;
}
.dialog::before {
background:url('./images/2220bfc21dded1378729809b2eb5e926.jpg')no-repeat center;
background: cover;
content: '';
position: absolute;;
top: 0; bottom: 0;
left: 0; right: 0;
-webkit-filter: blur(8px); /* Chrome, Opera */
-moz-filter: blur(8px);
-ms-filter: blur(8px);
filter: blur(8px);
filter: progid:DXImageTransform.Microsoft.Blur(PixelRadius=10, MakeShadow=false); /* IE6~IE9 */
z-index: -1;
}
</style>
</head>
<body>
<div class="dialog">
<h2>Love of Crystal </h2>
<p>In both white head</p>
</div>
</body>
</html>
网友评论