css 背景透明 div 不透明

background-color: rgb(0, 0, 0,0.5);

 



<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
 <title>CodePen - Counterrotation</title>
<style>
        .mask {
        position: fixed;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        background-color: rgb(0, 0, 0,0.5);
       
        
        z-index: 9888;
        transition: all 1s;
        display: none
    }

.qmdot {
  height: 160px;
  width: 160px;
  box-sizing: border-box;
  position: absolute;
  left: 40%;
  top: 32%;
}

.qmdot:before {
  content: "";
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgb(71,207, 46,115);
  filter:Alpha(opacity=50);
  box-sizing: border-box;
  margin-top: -15px;
  opacity: 1;
  -webkit-animation: before 2s ease-in infinite;
          animation: before 2s ease-in infinite;
}

.qmdot:nth-of-type(1) {
  -webkit-transform: rotate(25.7142857143deg);
          transform: rotate(25.7142857143deg);
}

.qmdot:nth-of-type(1):before {
  -webkit-animation-delay: -0.1s;
          animation-delay: -0.1s;
}

.qmdot:nth-of-type(2) {
  -webkit-transform: rotate(51.4285714286deg);
          transform: rotate(51.4285714286deg);
}

.qmdot:nth-of-type(2):before {
  -webkit-animation-delay: -0.2s;
          animation-delay: -0.2s;
}

.qmdot:nth-of-type(3) {
  -webkit-transform: rotate(77.1428571429deg);
          transform: rotate(77.1428571429deg);
}

.qmdot:nth-of-type(3):before {
  -webkit-animation-delay: -0.3s;
          animation-delay: -0.3s;
}

.qmdot:nth-of-type(4) {
  -webkit-transform: rotate(102.8571428571deg);
          transform: rotate(102.8571428571deg);
}

.qmdot:nth-of-type(4):before {
  -webkit-animation-delay: -0.4s;
          animation-delay: -0.4s;
}

.qmdot:nth-of-type(5) {
  -webkit-transform: rotate(128.5714285714deg);
          transform: rotate(128.5714285714deg);
}

.qmdot:nth-of-type(5):before {
  -webkit-animation-delay: -0.5s;
          animation-delay: -0.5s;
}

.qmdot:nth-of-type(6) {
  -webkit-transform: rotate(154.2857142857deg);
          transform: rotate(154.2857142857deg);
}

.qmdot:nth-of-type(6):before {
  -webkit-animation-delay: -0.6s;
          animation-delay: -0.6s;
}

.qmdot:nth-of-type(7) {
  -webkit-transform: rotate(180deg);
          transform: rotate(180deg);
}

.qmdot:nth-of-type(7):before {
  -webkit-animation-delay: -0.7s;
          animation-delay: -0.7s;
}

.qmdot:nth-of-type(8) {
  -webkit-transform: rotate(205.7142857143deg);
          transform: rotate(205.7142857143deg);
}

.qmdot:nth-of-type(8):before {
  -webkit-animation-delay: -0.8s;
          animation-delay: -0.8s;
}

.qmdot:nth-of-type(9) {
  -webkit-transform: rotate(231.4285714286deg);
          transform: rotate(231.4285714286deg);
}

.qmdot:nth-of-type(9):before {
  -webkit-animation-delay: -0.9s;
          animation-delay: -0.9s;
}

.qmdot:nth-of-type(10) {
  -webkit-transform: rotate(257.1428571429deg);
          transform: rotate(257.1428571429deg);
}

.qmdot:nth-of-type(10):before {
  -webkit-animation-delay: -1s;
          animation-delay: -1s;
}

.qmdot:nth-of-type(11) {
  -webkit-transform: rotate(282.8571428571deg);
          transform: rotate(282.8571428571deg);
}

.qmdot:nth-of-type(11):before {
  -webkit-animation-delay: -1.1s;
          animation-delay: -1.1s;
}

.qmdot:nth-of-type(12) {
  -webkit-transform: rotate(308.5714285714deg);
          transform: rotate(308.5714285714deg);
}

.qmdot:nth-of-type(12):before {
  -webkit-animation-delay: -1.2s;
          animation-delay: -1.2s;
}

.qmdot:nth-of-type(13) {
  -webkit-transform: rotate(334.2857142857deg);
          transform: rotate(334.2857142857deg);
}

.qmdot:nth-of-type(13):before {
  -webkit-animation-delay: -1.3s;
          animation-delay: -1.3s;
}

.qmdot:nth-of-type(14) {
  -webkit-transform: rotate(360deg);
          transform: rotate(360deg);
}

.qmdot:nth-of-type(14):before {
  -webkit-animation-delay: -1.4s;
          animation-delay: -1.4s;
}

@-webkit-keyframes wrapper {
  0% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
  }
}

@keyframes wrapper {
  0% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
  }
}
@-webkit-keyframes before {
  0% {
    -webkit-transform: scale(1);
            transform: scale(1);
    opacity: 1;
  }
  5% {
    -webkit-transform: scale(1);
            transform: scale(1);
  }
  45% {
    -webkit-transform: scale(0.4);
            transform: scale(0.4);
  }
  50% {
    -webkit-transform: scale(0.4);
            transform: scale(0.4);
    opacity: 0.8;
  }
  55% {
    -webkit-transform: scale(0.4);
            transform: scale(0.4);
    opacty: 0.8;
  }
  100% {
    -webkit-transform: scale(1);
            transform: scale(1);
    opacity: 1;
  }
}
@keyframes before {
  0% {
    -webkit-transform: scale(1);
            transform: scale(1);
    opacity: 1;
  }
  5% {
    -webkit-transform: scale(1);
            transform: scale(1);
  }
  45% {
    -webkit-transform: scale(0.4);
            transform: scale(0.4);
  }
  50% {
    -webkit-transform: scale(0.4);
            transform: scale(0.4);
    opacity: 0.8;
  }
  55% {
    -webkit-transform: scale(0.4);
            transform: scale(0.4);
    opacty: 0.8;
  }
  100% {
    -webkit-transform: scale(1);
            transform: scale(1);
    opacity: 1;
  }
}

    </style>
     <script src="jquery-3.4.0.min.js"></script>
</head>
<body  >
 
    <button id="test" > Loading</button>
    <button id="test1" > out</button>
        <div class="mask">
<div class='qmdot'></div><div class='qmdot'></div><div class='qmdot'></div><div class='qmdot'></div><div class='qmdot'></div><div class='qmdot'></div><div class='qmdot'></div>
<div class='qmdot'></div><div class='qmdot'></div><div class='qmdot'></div><div class='qmdot'></div><div class='qmdot'></div><div class='qmdot'></div><div class='qmdot'></div>
 
 </div>

 <script>
 $(".mask").fadeIn();
document.getElementById("test").onclick=function(){
    $(".mask").fadeIn();
}
document.getElementById("test1").onclick=function(){
    $(".mask").fadeOut();
}
  
 </script>
 </body>
</html>

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Farmwang

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

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

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

打赏作者

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

抵扣说明:

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

余额充值