网页蒙层实现加载效果

最近做移动应用的 一个商城项目,需要实现一个全屏蒙层显示加载效果,记录下来,以免以后用的着,,效果图:

直接上代码:


<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title>半透明实例在线演示 </title>
		<style>
			@-webkit-keyframes rotation {
				from {
					-webkit-transform: rotate(0deg);
				}
				to {
					-webkit-transform: rotate(360deg);
				}
			}
			/* 1s表示图片旋转一圈的时间,**/
			.Rotation {
				position: absolute;
				left: 30px;
				top: 15px;
				width: 70px;
				height: 70px;
				color: #F00;
				-webkit-transform: rotate(360deg);
				animation: rotation 1s linear infinite;
				-moz-animation: rotation 1s linear infinite;
				-webkit-animation: rotation 1s linear infinite;
				-o-animation: rotation 1s linear infinite;
			}
			/**图片的圆角*/
			.img {
				border-radius: 70px;
			}
			/**opacity 透明度**/
			.div-a {
				position: absolute;
				top: 0;
				bottom: 0;;
				width: 100%;
				height: 100%;
				filter: alpha(Opacity=60);
				-moz-opacity: 0.6;
				opacity: 0.6,;
				background: #CCCCCC;
			}
			.img-div{
				position: relative;
				top: 40%;
				margin: 0 auto;
				width: 300px;
				height: 100px;
				background: #FFFFFF;
				text-align: center;
				border: 1px #E8E8E8 solid;
			}
			.loading{
				display: inline-block;
				font-size: 28px;
				margin-left:40px ;
				line-height: 28px;
				margin-top: 36px;
			}
			
		</style>
	</head>

	<body>
		<!--
        	使用的时候先让下面的这个div隐藏,到需要的时候用js让他显示出来就行了
        -->
		<div class="div-a">
			<div class="img-div">
				<img class="Rotation img" src="loading.png" width="500" height="500" /><span class="loading">加载中...</span>
			</div>
			
		</div>
	
	</body>

</html>






  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

徐楠_01

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值