我正在为一位朋友设计一个登录页面,并且我试图在图像上制作一个模糊的框。这就是我要远,创建用于登录的模糊框
<html>
<link rel="stylesheet" href="css/homepage.css">
<!-- Page starts here -->
<body id="bg">
<div class="center">
<div id="image" class="image center">
<img>
</div>
</div>
</body>
</html>
而CSS
#bg {
height: 100vh;
width: 100%;
background: url(http://www.funchap.com/wp-content/uploads/2014/02/amazing-horse-pictures.jpg) center no-repeat;
background-size: cover;
z-index: -2;
margin: 0;
}
.image {
background-size: cover;
height: 62%;
width: 22.5%;
-webkit-filter: blur(10px);
-moz-filter: blur(10px);
-o-filter: blur(10px);
-ms-filter: blur(10px);
filter: blur(10px);
overflow: hidden;
border-style: hidden;
border-radius: 25px;
border-color: transparent;
}
.image img {
background: url(http://www.funchap.com/wp-content/uploads/2014/02/amazing-horse-pictures.jpg) center;
background-size: cover;
overflow: hidden;
height: 300%;
width: 300%;
}
.center {
position: absolute;
margin: auto;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
#logo {
z-index: 0;
width: 13%;
margin: auto;
top: 0;
bottom: 0;
left: 0;
right: 0;
position: absolute;
padding-bottom: 15%;
}
我不知道为什么它不能在框中排队。欢迎任何帮助。
P.S.如果你想知道,马的图像是2560 x 1600。
在此先感谢。
这是什么呢:** ** 建议 – Mojtaba
看着你的图像配'代码img' - 你不能在一个空'img'标签设置背景属性和期待它的工作。将图片网址放在img标签的'src'属性中,或者使用带背景的块元素。 – chazsolo