*新闻详情页*/>
日期:2021-01-20 类型:科技新闻 我要分享
关键词:如何制作微信小程序,微信小程序源码,小程序码生成,凡科网微信小程序,微信公众号小程序
做1个登陆页,全屏情况图毛玻璃实际效果,完成方式以下:
HTML:
<body> <div class="login-wrap"> <div class="login-mask"></div> <div class="login-box"></div> </div> <script> var w = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; var h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; $('.login-mask').css("height", h); $('.login-mask').css("width", w); </script> </body>
CSS:
.login-wrap { overflow: hidden; } .login-mask { /* IE6~IE9 */ filter: progid: DXImageTransform.Microsoft.Blur(PixelRadius=100, MakeShadow=false); -webkit-filter: blur(100px); -moz-filter: blur(100px); -ms-filter: blur(100px); filter: blur(100px); background-image: url(../../../img/background/home-bg⑶.jpg); background-repeat: no-repeat; background-size: cover; background-attachment: fixed; background-position: center; position: absolute; z-index: 1; } .login-box { width: 300px; height: 400px; background-color: rgba(255, 255, 255, 0.5); display: block; border: 1px solid rgba(183, 183, 183, 0.47); border-radius: 6px; position: absolute; left: 50%; margin-right: auto; margin-left: ⑴50px; margin-top: 10%; z-index: 2; }
实际效果以下:
能够发现旁边是有白边的,这是1种blur的值很大的状况下。此时的处理方式是立即将background-size:cover;改为background-size:150% 150%;就可以了。实际效果图以下:
细心看能够发现白边不那末显著了。
此外1种便是在blur的值较为小的状况下,例如将上述的blur值改为20,实际效果以下:
能够看出白边很显著,这时候候假如给body加上一样的情况图的话,白边就会消退:
body{ background-image: url(../../../img/background/home-bg⑶.jpg); background-repeat: no-repeat; background-size: cover; background-attachment: fixed; background-position: center; }
实际效果图以下:
能够看到边沿的差别很显著。可是比照有点显著,实际效果其实不好,将blur的值再改小1点,改为5,,实际效果图以下:
边沿的白边去掉了,而且看起来并不是那末违和了。
以上便是本文的所有內容,期待对大伙儿的学习培训有一定的协助,也期待大伙儿多多适用脚本制作之家。
Copyright © 2002-2020 如何制作微信小程序_微信小程序源码_小程序码生成_凡科网微信小程序_微信公众号小程序 版权所有 (网站地图) 粤ICP备10235580号