25

1、背景渐变色效果

.main{
        background: -webkit-linear-gradient(#a18cd1, #fbc2eb); /* Safari 5.1 - 6.0 */
        background: -o-linear-gradient(#a18cd1, #fbc2eb); /* Opera 11.1 - 12.0 */
        background: -moz-linear-gradient(#a18cd1, #fbc2eb); /* Firefox 3.6 - 15 */
        background: linear-gradient(#a18cd1, #fbc2eb); /* 标准的语法 */  
      }

图片描述

2、三角形效果

.main{
        width:0px;height:0px;
        border-right:50px solid  rgba(0,0,0,0);
        border-bottom:50px solid #fbc2eb;
        border-left:50px solid  rgba(0,0,0,0);
      }

图片描述
3、圆环效果

.main{
        width: 100px;
        height: 100px;
        background-color: #fbc2eb;
        border-radius: 50%;
      }
.main:after{
        content: " ";
        display: block;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background-color: #fff;
        position: relative;
        top: 25px;
        left: 25px;
      }

图片描述
4、div上下跳动

@keyframes tips{
          25% {transform: translateY(-3px);}
          50%{transform: translateY(0);}
          75% {transform: translateY(3px);}
          100% {transform: translateY(0);}
      }
.main{
        width: 50px;
        height: 50px;
        background: #fbc2eb;
        -webkit-animation: tips 1s linear infinite;
        animation: tips 1s linear infinite;
      }

图片描述
5、加载loading效果

.load{width: 100px;height: 100px;position: relative;margin: 0 auto;margin-top:100px;}
.load span{display: inline-block;width: 17px;height: 17px;border-radius: 50%;background: #fbc2eb;position: absolute;-webkit-animation: load 1.04s ease infinite;}
@-webkit-keyframes load{
    0%{
        opacity: 1;
    }
    100%{
        opacity: 0.2;
    }
}
.load span:nth-child(1){left: 0;top: 50%;margin-top:-8px;-webkit-animation-delay:0.13s;}
.load span:nth-child(2){left: 15px;top: 15px;-webkit-animation-delay:0.26s;}
.load span:nth-child(3){left: 50%;top: 0;margin-left: -8px;-webkit-animation-delay:0.39s;}
.load span:nth-child(4){top: 15px;right:15px;-webkit-animation-delay:0.52s;}
.load span:nth-child(5){right: 0;top: 50%;margin-top:-8px;-webkit-animation-delay:0.65s;}
.load span:nth-child(6){right: 15px;bottom:15px;-webkit-animation-delay:0.78s;}
.load span:nth-child(7){bottom: 0;left: 50%;margin-left: -8px;-webkit-animation-delay:0.91s;}
.load span:nth-child(8){bottom: 15px;left: 15px;-webkit-animation-delay:1.04s;}
<!-- html代码 -->
<div class="load">
    <span></span>
    <span></span>
    <span></span>
    <span></span>
    <span></span>
    <span></span>
    <span></span>
    <span></span>
</div>

图片描述

文章链接

qrcode_for_gh_3db3f32f2d94_344.jpg


三更半夜写代码
406 声望15 粉丝

前端笔记整理分享