• FCC---Create Visual Direction by Fading an Element from Left to Right---一个带好看背景色的圆形图案,从左到右移动,透明度opacity渐变为0.1,背景色渐渐消失的效果


    For this challenge, you'll change the opacity of an animated element so it gradually fades as it reaches the right side of the screen.

    In the displayed animation, the round element with the gradient background moves to the right by the 50% mark of the animation per the @keyframes rule.

    练习题目:

    Target the element with the id of ball and add the opacity property set to 0.1 at 50%, so the element fades as it moves to the right.

    练习代码:

     1 <style>
     2 
     3   #ball {
     4     width: 70px;
     5     height: 70px;
     6     margin: 50px auto;
     7     position: fixed;
     8     left: 20%;
     9     border-radius: 50%;
    10     background: linear-gradient(
    11       35deg,
    12       #ccffff,
    13       #ffcccc
    14     );
    15     animation-name: fade;
    16     animation-duration: 3s;
    17   }
    18 
    19   @keyframes fade {
    20     50% {
    21       left: 60%;
    22       opacity: 0.1;
    23     }
    24   }
    25 
    26 </style>
    27 
    28 <div id="ball"></div>

    效果:

    一个带好看背景色的圆形图案,从左到右移动,透明度opacity渐变为0.1,背景色渐渐消失的效果

  • 相关阅读:
    201141 live the lie until the lie becomes your life
    my php & mysql FAQ
    suger日料财务
    python 应用thrift thrift的监控fb303
    cherryPy学习
    my linux FAQ
    Javascript无阻塞加载方法
    设计模式学习笔记之组合模式模式
    【转】cookie
    C# 多线程
  • 原文地址:https://www.cnblogs.com/jane-panyiyun/p/11738624.html
Copyright © 2020-2023  润新知