【发布时间】:2018-09-23 19:26:11
【问题描述】:
我们遇到了表单及其父 div 的问题。我们试图为父 div 的landingboxForm 引入磨砂玻璃样式,但如果我们使用伪元素,则不会发生任何事情。
本教程来自https://medium.com/@AmJustSam/how-to-do-css-only-frosted-glass-effect-e2666bafab91,对其他人来说效果很好。我只是没有成功将它移植到我们的登录页面。
有谁知道为什么 :before div 标签在 Chrome 检查器中只是灰色的以及为什么它没有出现?
CSS:
.lp-sorba {
background-size: cover;
position: absolute;
width: 100%;
top: 0;
left: 0;
bottom: 0;
height: 900px !important;
}
.lp-sorba .landingpageHeader {
height: 80px;
background: #1d89d2;
}
.lp-sorba #hs-link-logo > img {
margin-top: 22px;
}
.lp-sorba .landingboxForm:before {
content:" ";
background: inherit;
left: 0;
right: 0;
top: 0;
height: 100%;
width: 100%;
bottom: 0;
box-shadow: inset 0 0 0 3000px rgba(255,255,255,0.3);
filter: blur(10px) !important;
}
.lp-sorba .landingboxForm {
background: inherit;
width: 100%;
height: 100%;
position: relative;
border-radius: 5px;
box-shadow: 0 23px 40px rgba(0,0,0,0.2);
padding: 20px;
border: 0.5px solid #edebeb;
}
【问题讨论】:
-
能否请您添加您目前掌握的 CSS 代码?没看到,也许你是在不支持 CSS 过滤器的浏览器中查看的? caniuse.com/#feat=css-filters
-
感谢我添加了 CSS。
标签: css-selectors pseudo-element pseudo-class