In the previous challenge, you changed the animation rates for two similarly animated elements by altering their @keyframes rules.

You can achieve the same goal by manipulating the animation-duration of multiple elements.

In the animation running in the code editor, there are three "stars" in the sky that twinkle at the same rate on a continuous loop.

To make them twinkle at different rates, you can set the animation-duration property to different values for each element.

练习题目:

In the previous challenge, you changed the animation rates for two similarly animated elements by altering their @keyframes rules.

You can achieve the same goal by manipulating the animation-duration of multiple elements.

In the animation running in the code editor, there are three "stars" in the sky that twinkle at the same rate on a continuous loop. To make them twinkle at different rates, you can set the animation-duration property to different values for each element.

练习代码:

 <style>
.stars {
background-color: white;
height: 30px;
width: 30px;
border-radius: 50%;
animation-iteration-count: infinite;
} .star-1 {
margin-top: 15%;
margin-left: 60%;
animation-duration: 1s;
animation-name: twinkle;
} .star-2 {
margin-top: 25%;
margin-left: 25%;
animation-duration: 0.9s;
animation-name: twinkle;
} .star-3 {
margin-top: 10%;
margin-left: 50%;
animation-duration: 1.1s;
animation-name: twinkle;
} @keyframes twinkle {
20% {
transform: scale(0.5);
opacity: 0.5;
}
} #back {
position: fixed;
padding:;
margin:;
top:;
left:;
width: 100%;
height: 100%;
background: linear-gradient(black, #000099, #66c2ff, #ffcccc, #ffeee6);
}
</style> <div id="back"></div>
<div class="star-1 stars"></div>
<div class="star-2 stars"></div>
<div class="star-3 stars"></div>

效果如下:

FCC---Animate Multiple Elements at Variable Rates---还可以改循环时间,达到不同律动频率的效果的更多相关文章

  1. VUE之命令行报错:Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead 解决办法

    Failed to compile. ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-5992 ...

  2. VUE编译报错 Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead

    背景: 在使用VUE添加标签的时候编译报错,报错如下: Component template should contain exactly one root element. If you are u ...

  3. vue报错:Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.

    在.vue文件中引入了 element-ui 的 table 和 pagination 组件后,报错:Component template should contain exactly one roo ...

  4. python+opencv中最近出现的一些变化( OpenCV 官方的 Python tutorial目前好像还没有改过来?) 记一次全景图像的拼接

    最近在学习过程中发现opencv有了很多变动, OpenCV 官方的 Python tutorial目前好像还没有改过来,导致大家在学习上面都出现了一些问题,现在做一个小小的罗列,希望对大家有用 做的 ...

  5. FCC---Animate Elements at Variable Rates----一闪一闪亮晶晶,不同的闪动节奏

    There are a variety of ways to alter the animation rates of similarly animated elements. So far, thi ...

  6. 组件嵌套时报:Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.

    在组件嵌套的过程中,报了一个错误: 这里报错的原因是:vue的组件(模板)只能有一个根节点,即.vue文件中的<template>标签下只能有一个子元素. 因此,建议大家在写.vue组件的 ...

  7. Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.

    运行代码时,一直报错: 经过查询后才知道,vue模板只能有一个跟对象 我是这样写的 最后修改为 就可以正常运行了

  8. 【错误总结】Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.

    大致意思是因为模板里面应该包含一个根元素,使用组件的时候应该用div或p标签包起来

  9. 15+优秀的jQuery视差插件

    jQuery视差效果的应用越来越广泛了,今天就给大家分享一些优秀的jQuery视差插件,它们确实太棒了! 原文地址:http://www.goodfav.com/jquery-parallax-plu ...

随机推荐

  1. Linux中哪些工具堪称神器?

    作者:int32bit www.zhihu.com/question/59227720 ag:比grep.ack更快的递归搜索文件内容. Github地址: https://github.com/gg ...

  2. C#二位数组 数组矩阵对角线之和

    二维数组: public static void Main(string[] args) { int[,] a = new int[3, 3]; Random rom = new Random(); ...

  3. windows平台多网卡设置路由

    添加路由命令: route add 192.168.4.0 mask 255.255.255.0 192.168.4.1 metric 20 if 11 -p 其中192.168.4.0 是网络目标, ...

  4. Selenium(四):CSS选择器(一)

    1. CSS选择器 前面我们学习了根据 id.class属性.tag名选择元素. 如果我们要选择的元素没有id.class 属性,或者有些我们不想选择的元素也有相同的id.class属性值,怎么办呢? ...

  5. 操作系统篇之Linux命令操作和redis安装以及基本使用

    电脑操作系统 : windows7,8,10,xp,win98 操作系统 : linux ax unix 以后开发项目是部署在服务器上,服务器一般采用linux. linux的优点:系统稳定,操作速度 ...

  6. vue v-if和v-show的区别

    其中v-if依赖于控制DOM节点,而v-show是依赖于控制DOM节点的display属性. 当v-show传入的值为true时,对应DOM元素的display的值为block之类的,反之为false ...

  7. c语言内存

    冯诺依曼结构是:数据和代码放在一起. 哈佛结构是:数据和代码分开存在.内存管理fiLO 先进后出 栈FIFO 先进先出 队列栈的特点是入口即出口,另一个口是堵死的,所以先进去的后出来队列的特点是入口和 ...

  8. Good start is a half success(2019-04-07)

    一. 回顾你过去将近3年的学习经历. (1)当初你报考的时候,是真正喜欢计算机这个专业吗?. (2)你现在后悔选择了这个专业吗?. (3)你认为你现在最喜欢的领域是什么(可以是计算机的也可以是其它领域 ...

  9. How to restore and recover a database from an RMAN backup. (Doc ID 881395.1)

    APPLIES TO: Oracle Database - Enterprise Edition - Version 10.1.0.2 to 11.2.0.2 [Release 10.1 to 11. ...

  10. MSSQL注入:显错注入及反弹注入

    前言: MSSQL注入攻击是最为复杂的数据库攻击技术,由于该数据库功能十分强大,存储过程以及函数语句十分丰富,这些灵活的语句造就了新颖独特的攻击思路. MSSQL的显错注入操作: 以联合查询为例: 猜 ...