transition transform animate的使用
注:代码显示效果可以自行粘贴复制查看
- transition(过渡),主要是关注property的变化主要有四个属性transition-property、transition-durantion、transition-timing-function、transition-delay,transition是对这四个属性的简写
- transition-property:要过渡的元素
- transition-durantion:过渡持续的事件
- transition-timing-function:过渡的速度,ease(慢开始然后中间块结束慢),ease-in(慢开始),ease-out(慢结束),ease-in-out(慢开始慢结束),cubic-bezier
<div class="transition-test"></div>
<style>
.transition-test{
display: block;
height: 100px;
width: 100px;
background-color: red; /*transition: width 3s ease,background-color 3s ease;*///如果要过渡的元素的过渡方式不同就用这种写法
transition:all 3s ease;//填写顺序是transition-property(必填)、transition-durantion(必填,不然没有过渡效果)、transition-timing-function、transition-delay
}
.transition-test:hover{
width:%;
background-color: yellow;
}
</style>
- transform(变换)translate(x,y) rotate() scale() skew() martix() 还有其他的3d效果在:http://www.w3school.com.cn/css3/css3_2dtransform.asp
<div>你好。这是一个 div 元素。</div>
<style>
div
{
width:100px;
height:75px;
background-color:yellow;
border:1px solid black;
transition:all 3s;
}
div:hover
{
transform:rotate(360deg);
}
</style>
- animate(动画)有如下属性:
- @keyframes捆绑到某个选择器
- animation:除了animation-play-state之外的属性的其他所有属性的简写
- animation-name:固定@keyframes动画的名称
- animation-duration:完成一个周期所用时长
- animation-timing-function:速度曲线,默认时ease
- animation-delay:动画何时开始
- animation-count:动画播放次数
- animation-direction:下一动画是否逆向播放
- animation-paly-state:动画的显示状态运行还是暂停
- animation-fill-mode:动画之外的状态
<div></div>
<style>
div
{
width:100px;
height:100px;
background:red;
position:relative;
animation:myfirst 5s linear infinite alternate;
animation-play-state:running; }
@keyframes myfirst
{
% {background:red; left:0px; top:0px;}
% {background:yellow; left:200px; top:0px;}
% {background:blue; left:200px; top:200px;}
% {background:green; left:0px; top:200px;}
% {background:red; left:0px; top:0px;}
}
</style>
transition transform animate的使用的更多相关文章
- css transition transform animation例子讲解
1.transition属性: transition属性是一个速记属性有四个属性:transition-property , transition-duration, transition-timin ...
- css动画(transition/transform/animation)
在开发中,一个好的用户操作界面,总会夹杂着一些动画.css用对少的代码,来给用户最佳的体验感,下面我总结了一些css动画属性的使用方法及用例代码供大家参考,在不对的地方,希望大佬直接拍砖评论. 1 t ...
- css中关于transform、transition、animate的区别
写动画经常会用到这几个属性,他们之间有什么区别呢? 1.transform 每每演示transform属性的,看起来好像都是带动画.这使得小部分直觉化思维的人(包括我)认为transform属性是动画 ...
- vue学习(8)-过渡transition&动画animate
进入之前 离开之后 v-enter---v-enter-to v-lea ...
- transition&transform,CSS中过度和变形的设置
设置样式的过度效果transition-property: none/all; transition-duration:2s;运动时间,默认是0秒 transition-delay:0s; 延迟时间默 ...
- transition & transform
transition: 过渡时间 被改变属性 执行函数 延迟时间 transition:width 1s,height 2s 1s; transform: 平移(translate).缩放(scale ...
- CSS3 transition/transform
Transition 1.简写属性transition,可以包括四个属性,这四个属性的顺序按照下面介绍的顺序书写,即transition:property duration timing-functi ...
- css3属性 transition transform
1.transition 译:过渡,转变 可以设置过渡属性 transition: property duration timing-function delay; transition-proper ...
- CSS3 傻傻分不清楚的transition, transform 和 animation
transition transition允许css的属性值在一定的时间区间内平滑地过渡,语法如下: transition : transition-property transition-durat ...
随机推荐
- MLT教程:从BXL文件导入Altium Designer原理图封装和PCB封装
在TI官网的封装文件中提供弄BXL文件可以导出Altium Designer的封装库和原理图库. 这个界面往下面拉会看到: 然后可以下载各种封装的bxl文件了.下面视频说明bxl文件如何导出成功. 如 ...
- 使用union all 命令之后如何对hive表格进行去重
业务场景大概是这样的,这里由两个hive表格,tableA 和 tableB, 格式内容都是这样的: uid cate1 cate2 在hive QL中,我们知道union有着自动去重的功能,但是那是 ...
- L2-029 特立独行的幸福 (25 分)
L2-029 特立独行的幸福 (25 分) 对一个十进制数的各位数字做一次平方和,称作一次迭代.如果一个十进制数能通过若干次迭代得到 1,就称该数为幸福数.1 是一个幸福数.此外,例如 19 经过 ...
- 笔记-scrapy-去重
笔记-scrapy-去重 1. scrapy 去重 scrapy 版本:1.5.0 第一步是要找到去重的代码,scrapy在请求入列前去重,具体源码在scheduler.py: def en ...
- 剑指Offer - 九度1510 - 替换空格
剑指Offer - 九度1510 - 替换空格2013-11-29 20:53 题目描述: 请实现一个函数,将一个字符串中的空格替换成“%20”.例如,当字符串为We Are Happy.则经过替换之 ...
- 《Cracking the Coding Interview》——第8章:面向对象设计——题目3
2014-04-23 18:10 题目:设计一个点唱机. 解法:英文叫Musical Jukebox.这是点唱机么?卡拉OK么?这种题目实在是云里雾里,又没有交流的余地,我索性用一个vector来表示 ...
- python学习笔记十五:日期时间处理笔记
#-*- coding: utf-8 -*- import datetime #给定日期向后N天的日期 def dateadd_day(days): d1 = datetime.datetime.no ...
- Eclipse 出现“polling news feeds”的解决办法
小编突然心血来潮,安装了一下Java的环境,eclipse的IDE来写点Java,但是是不是出现以下的弹窗,实在是闹心,后来网上看了前辈们的解决办法,特此记录一下.如有侵权,敬请告知!!! 1. 找到 ...
- Djano之写api使用django_rest_framework【海瑞博客】
使用django rest framework 可以更快速和友好的编写api,当然网上有很多教程,对于高手来说相对很简单,对于新手来说,根本搞不明白.那是你没有搞明白你自己的职责,做为后端,我们只要提 ...
- Python网络编程(http协议,IO多路复用、select内核监听)
前言: 什么是IO? 分为IO设备和IO接口两个部分 如Linux系统,I/O操作可以有多种方式 比如DIO(DirectI/O) AIO(AsynchronousI/O异步I/O) Memory-M ...