gpt4 book ai didi

html - 为什么模糊滤镜在此示例中不起作用

转载 作者:太空宇宙 更新时间:2023-11-03 22:24:14 24 4
gpt4 key购买 nike

我试图给我的表单背景模糊它背后的一切。表格后面会有一些内容。我希望此内容可见但模糊。应该是某种玻璃效果。我正在使用 filter: blur(10px); 效果。我已经检查了几个教程和视频,但仍然无法正常工作。我究竟做错了什么?这是 fiddle :

http://jsfiddle.net/xceg89m1/

body {
background: url(https://thecentraltrend.com/wp-content/uploads/2017/02/tunnel.jpg);
background-size: cover;
color: white;
}

#register {
position: absolute;
top: -10px;
width: 100%;
height: 100%;
z-index: 11000;
display: table;
color: white;
}

#registerBlock {
display: table-cell;
text-align: center;
vertical-align: middle;
}

#registerForm {
display: inline-block;
position: relative;
overflow: hidden;
z-index: 2;
box-shadow: 0 0 32px rgba(0,0,0,0.7);
border-radius: 6px;
padding: 5px;
box-sizing: border-box;
background: inherit;
}

#registerForm .blur {
position: absolute;
top: 0;
left: 0;
width: 150%;
height: 150%;
background: url(https://thecentraltrend.com/wp-content/uploads/2017/02/tunnel.jpg);
background-size: cover;
transform: translate(-20%, -20%);
filter: blur(5px);
z-index: -1;
}
<body>
<div>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</p>
</div>
<div id="register">
<div id="registerBlock">
<div id="registerForm">
<h2>Please complete below form</h2>
<p><span class="error">* required field</span></p>
<form method="post">
Name: <input type="text" name="name" value="">
<span class="error">*</span>
<br><br>
E-mail: <input type="text" name="email" value="">
<span class="error">*</span>
<br><br>
Website: <input type="text" name="website" value="">
<span class="error"></span>
<br><br>
Comment: <textarea name="comment" rows="5" cols="40"></textarea>
<br><br>
<input type="submit" name="submit" value="Submit">
</form>
<div class="blur"><img src="https://thecentraltrend.com/wp-content/uploads/2017/02/tunnel.jpg" width="100%" height="100%"/></div>
</div>
</div>
</div>
</body>

最佳答案

Blur 实际上会模糊该对象内的内容。它不会模糊 div 下面的所有内容。例如,如果您在 div 中添加图像,您会注意到模糊效果按预期工作。

<div class="blur">
<img src="https://thecentraltrend.com/wp-content/uploads/2017/02/tunnel.jpg" />
</div>

关于html - 为什么模糊滤镜在此示例中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52092649/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com