本文最后更新于2023年01月20日,已超过835天没有更新。如果文章内容或图片资源失效,请留言反馈,我会及时处理,谢谢!
您阅读这篇文章共耗时:
介绍:
css美化最好的方法就是通过外链引入,这样大大减少了自定义css代码页面的臃肿。
教程开始:
css代码:
在网站根目录任意位置创建一个新的css文件,文件名随便整,在把下面的css代码复制粘贴进去保存
/*css loding*/
#loading {
position: fixed !important;
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: 999;
background: #000;
opacity: 0.7;
filter: alpha(opacity=70);
font-size: 14px;
line-height: 20px
}
#loading-one {
color: #fff;
position: absolute;
top: 50%;
left: 50%;
margin: 50px 0 0 -80px;
padding: 3px 10px
}
.circle {
background-color: rgba(0,0,0,0);
border: 5px solid rgba(0,183,229,0.9);
opacity: .9;
border-right: 5px solid rgba(0,0,0,0);
border-left: 5px solid rgba(0,0,0,0);
border-radius: 50px;
box-shadow: 0 0 35px #2187e7;
width: 50px;
height: 50px;
margin: -25px;
-moz-animation: spinPulse 1s infinite ease-in-out;
-webkit-animation: spinPulse 1s infinite linear;
position: absolute;
top: 50%;
left: 50%
}
.circle1 {
background-color: rgba(0,0,0,0);
border: 5px solid rgba(0,183,229,0.9);
opacity: .9;
border-left: 5px solid rgba(0,0,0,0);
border-right: 5px solid rgba(0,0,0,0);
border-radius: 50px;
box-shadow: 0 0 15px #2187e7;
width: 30px;
height: 30px;
margin: -15px;
position: relative;
top: -50px;
-moz-animation: spinoffPulse 1s infinite linear;
-webkit-animation: spinoffPulse 1s infinite linear;
position: absolute;
top: 50%;
left: 50%
}
@-moz-keyframes spinPulse {
0% {
-moz-transform: rotate(160deg);
opacity: 0;
box-shadow: 0 0 1px #2187e7
}
50% {
-moz-transform: rotate(145deg);
opacity: 1
}
100% {
-moz-transform: rotate(-320deg);
opacity: 0
}
}
@-moz-keyframes spinoffPulse {
0% {
-moz-transform: rotate(0deg)
}
100% {
-moz-transform: rotate(360deg)
}
}
@-webkit-keyframes spinPulse {
0% {
-webkit-transform: rotate(160deg);
opacity: 0;
box-shadow: 0 0 1px #2187e7
}
50% {
-webkit-transform: rotate(145deg);
opacity: 1
}
100% {
-webkit-transform: rotate(-320deg);
opacity: 0
}
}
@-webkit-keyframes spinoffPulse {
0% {
-webkit-transform: rotate(0deg)
}
100% {
-webkit-transform: rotate(360deg)
}
}
/*css loding*/
footer底部代码:
在主题文件 public 里面的 footer 文件里面添加以下代码。
<script>
jQuery(function() {
jQuery('#loading-one').empty().append('载 入 完 成 . . .').parent().fadeOut('slow');
jQuery('#loading').click(function() {
jQuery('#loading').fadeOut('slow');
});
});
</script>
文字可以自己改,改成你自己想要的文字即可。
主题后台 全局设置-自定义head 引入及代码:
<link type="text/css" rel="styleSheet" href="你的css文件路径" />
弄好这个链接之后放在后台的自定义head部分里面即可。当然还要在引入之前添加一串代码,相当于和这个css外部引入代码放在一起。
<div id="loading"> <p id="loading-one">努 力 载 入 中. . .</p > <div class="circle"></div> <div class="circle1"></div> </div>
将这串代码和外链引入同时放在主题后台 全局设置-自定义head即可。
然后就完成了,是不是特别简单,具体可看本站演示站。
演示图:
本文来自投稿,不代表本站立场,如若转载,请注明出处:http://xuan.ddwoo.top/index.php/archives/877/