FCC---Animate Multiple Elements at Variable Rates---还可以改循环时间,达到不同律动频率的效果
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---还可以改循环时间,达到不同律动频率的效果的更多相关文章
- 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 ...
- 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 ...
- 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 ...
- python+opencv中最近出现的一些变化( OpenCV 官方的 Python tutorial目前好像还没有改过来?) 记一次全景图像的拼接
最近在学习过程中发现opencv有了很多变动, OpenCV 官方的 Python tutorial目前好像还没有改过来,导致大家在学习上面都出现了一些问题,现在做一个小小的罗列,希望对大家有用 做的 ...
- FCC---Animate Elements at Variable Rates----一闪一闪亮晶晶,不同的闪动节奏
There are a variety of ways to alter the animation rates of similarly animated elements. So far, thi ...
- 组件嵌套时报: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组件的 ...
- 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 using v-if on multiple elements, use v-else-if to chain them instead.
大致意思是因为模板里面应该包含一个根元素,使用组件的时候应该用div或p标签包起来
- 15+优秀的jQuery视差插件
jQuery视差效果的应用越来越广泛了,今天就给大家分享一些优秀的jQuery视差插件,它们确实太棒了! 原文地址:http://www.goodfav.com/jquery-parallax-plu ...
随机推荐
- 某小公司RESTful、共用接口、前后端分离、接口约定的实践
作者:邵磊 juejin.im/post/59eafab36fb9a045076eccc3 前言 随着互联网高速发展,公司对项目开发周期不断缩短,我们面对各种需求,使用原有对接方式,各端已经很难快速应 ...
- 清新简约风格毕业论文答辩PPT模板推荐
不管是学生还是老师,应该经常会需要学生答辩的PPT模板,今天给大家推荐织梦58的学生答辩ppt模板. 模版来源:http://ppt.dede58.com/gongzuohuibao/26494.ht ...
- 自学_数据库<三>
数据库 数据库概述 DBMS(DataBase Management System,数据库管理系统)和数据库.平时谈到"数据库"可能有两种含义:MSSQLServer.Oracle ...
- 松软科技web课堂:JavaScript 数组
JavaScript 数组用于在单一变量中存储多个值. 实例 var cars = ["Saab", "Volvo", "BMW"]; 什么 ...
- flex下省略号的问题解决
最近在搞微信小程序,发现flex下使用省略号是没有效果的,而且还会打乱预期的结构,查询statckoverflow知道需要在父级设置min-width:0; 但是在我的尝试下,依然不行,原来在上层父级 ...
- windows下安装react
在 Windows 10 64 下创建 React App 由 SHUIJINGWAN · 2018/03/26 1.在官方网站:https://nodejs.org/zh-cn/ 下载推荐版本: ...
- 多个git合并,并保留log历史记录
面临的需求是:将多个git仓库作为一个单独目录,整合到一个新的git仓库中:并且保留历史记录. 1. 新建一个summary仓库 新建一个summary仓库,用于整合一系列git仓库. git clo ...
- RNN及其变体框架
RNN及其变体框架 含RNN推导 LSTM理解 理解LSTM网络 算法细节理解及参考文献
- NOIP 2016 玩具谜题
洛谷 P1563 玩具谜题 洛谷传送门 JDOJ 3136: [NOIP2016]玩具谜题 D1 T1 JDOJ传送门 Description 小南有一套可爱的玩具小人, 它们各有不同的职业. 有一天 ...
- Codeforces Round #602 (Div. 2, based on Technocup 2020 Elimination Round 3) B. Box 贪心
B. Box Permutation p is a sequence of integers p=[p1,p2,-,pn], consisting of n distinct (unique) pos ...