FCC---Make a CSS Heartbeat using an Infinite Animation Count----超级好看的心跳,粉色的
Here's one more continuous animation example with the animation-iteration-count property that uses the heart you designed in a previous challenge.
The one-second long heartbeat animation consists of two animated pieces.
The heart elements (including the :before and :after pieces) are animated to change size using the transform property, and the background div is animated to change its color using the background property.
练习题目:
Keep the heart beating by adding the animation-iteration-count property for both the back class and the heart class and setting the value to infinite. The heart:before and heart:after selectors do not need any animation properties.
练习代码:
<style>
.back {
position: fixed;
padding:;
margin:;
top:;
left:;
width: 100%;
height: 100%;
background: white;
animation-name: backdiv;
animation-duration: 1s;
animation-iteration-count: infinite;
} .heart {
position: absolute;
margin: auto;
top:;
right:;
bottom:;
left:;
background-color: pink;
height: 50px;
width: 50px;
transform: rotate(-45deg);
animation-name: beat;
animation-duration: 1s;
animation-iteration-count: infinite;
}
.heart:after {
background-color: pink;
content: "";
border-radius: 50%;
position: absolute;
width: 50px;
height: 50px;
top: 0px;
left: 25px;
}
.heart:before {
background-color: pink;
content: "";
border-radius: 50%;
position: absolute;
width: 50px;
height: 50px;
top: -25px;
left: 0px;
} @keyframes backdiv {
50% {
background: #ffe6f2;
}
} @keyframes beat {
0% {
transform: scale(1) rotate(-45deg);
}
50% {
transform: scale(0.6) rotate(-45deg);
}
} </style>
<div class="back"></div>
<div class="heart"></div>
效果:
跳动的粉心,背景颜色会更换,变大变小

FCC---Make a CSS Heartbeat using an Infinite Animation Count----超级好看的心跳,粉色的的更多相关文章
- css010 css的transform transition和animation
css010 css的transform transition和animation 看着没有一个能想起他们是干什么的.. 1. Transform Transform(变形) r ...
- 62.纯 CSS 创作一只蒸锅(感觉不好看呀)
原文地址:https://segmentfault.com/a/1190000015389338 HTML code: <!-- steamer: 蒸锅: lid: 盖子: pot: 锅 --& ...
- 【WEB前端系列之CSS】CSS3动画之Animation
前言 动画使用示例https://github.com/AndyFlower/web-front/tree/master/css3/loading 学习CSS3中Animation之前先来看一个动画特 ...
- css—动画(transform, transition, animation)
transform 静态属性,一旦写进style里面,会立即显示作用,无任何变化过程.(类似于left, right, top, bottom这类属性) 主要用来做元素的变形 改变元素样式的属性主要有 ...
- FCC---Animate Elements Continually Using an Infinite Animation Count---设置animation-iteration-count的次数为无限,让小球一直跳动
The previous challenges covered how to use some of the animation properties and the @keyframes rule. ...
- [CSS] Create a Card Flip Animation with CSS
Animation can be a powerful way to enhance a user experience. In this lesson, we'll walk through the ...
- [CSS] Build a Fluid Loading Animation in CSS
In this lesson, we will create a fluid loading animation using Animations and Transformations in CSS ...
- Odometer使用JavaScript和CSS制作数字滑动效果
Odometer是一个使用JavaScript和CSS技术,制作出数字上下滑动的动画效果插件,有点类似与我们的天然气的读数的动画效果,这个插件是轻量级的,压缩版本只有3kg,使用CSS3动画技术,所以 ...
- CSS+transform画动态表情
先给大家看下画完后是什么样子: 代码看这里: html代码: <body> <div class="emoji emoji_like"> <div c ...
随机推荐
- ETCD:基于角色的访问控制
原文地址:Role-based access control 总览 身份验证已添加到etcd 2.1中. etcd v3 API略微修改了身份验证功能的API和用户界面,以更好地适应新的数据模型.本指 ...
- css样式优先级计算规则
css样式的优先级分为引入优先级和声明优先级. 引入优先级 引入样式一般分为外部样式,内部样式,内联样式. 外部样式:使用link引入的外部css文件. 内部样式:使用style标签书写的css样式. ...
- 通过SSH隧道的本地转发实现Django连接远程数据库
SSH连接命令 默认连接的端口为22 1. 使用私钥 ssh -p connect_port user_name@host -i your_private_identity 2. 使用用户密码 ssh ...
- Mysql数据基本操作(增、删、改、查)
一.数据库配置 # 通过配置文件统一配置的目的: 统一管理 服务端(mysqld).客户端(client) 1.配置mysqld(服务端)的编码为utf-8,再创建数据库的时候,默认编码都采用了utf ...
- Java入门系列之包装类(四)
前言 上一节我们讲解了StringBuilder VS StringBuffer以及二者区别,本节我们来讲解包装类. 包装类 我们知道在Java中有8中基本数据类型,分为数值类型:byte.short ...
- Astyle 一键格式化项目代码
代码格式化差异问题: 一个团队有多个开发,因开发习惯不同,开发时少添加了空格.换行等. 格式化代码时,一般会将整个文档格式化,代码提交时会发现未知的修改项. Astyle格式化工具 官网下载地址:Ar ...
- Specify Action Settings 指定按钮设置
In this lesson, you will learn how to modify Action properties. The ClearTasks Action will be used. ...
- URL跳转绕过姿势
POC "@" http://www.target.com/redirecturl=http://whitelist.com@evil.com "\" http ...
- 一些有用的Function或Class Method,持续更新
一些有用的Function 或 Class Method Function/Class Method 类型 作用 模块 备注 co_cost_show_order_costs Func 显示生产订单. ...
- Linux系统学习 四、网络基础—互联网概述,互联网接入方式
互联网概述 WWW:万维网 FTP:文件传输协议 E-MAIL:电子邮件 WWW 典型的C/S架构 URL:统一资源定位 协议+域名或IP:端口+网页路径+网页名 http://www.xxx.com ...