css过渡
过渡transition是一个复合属性
例子1
.example{
width: 200px;
height: 100px;
background-color: blanchedalmond;
transition-duration: 3s;
transition-property: all;
transition-timing-function: ease;
transition-delay: 0s;
}
.example:hover{
width: 500px;
}
属性解析:
transition-duration:持续的时间,默认为0,是必需值,但是不能为0
transition-property:过渡的属性,默认值为all
transition-trming-function:过渡函数,默认值为ease
transition-delay:过渡延迟时间,默认值为0
过渡的属性:
1)背景颜色 background-color
.example4{
width: 200px;
height: 100px;
background-color: blanchedalmond;
/*代表持续时间为1s,延迟时间为2s*/
transition:2s;
}
.example4:hover{
background-color: #5cb85c;
width: 500px;
}
2) none:
3) all:所有的属性
4) width
5)width,background(可以写多个属性,可以用;分隔开)
注意:IE9-不支持该属性,safari3.1-6、IOS3.2-6.1、android2.1-4.3需要添加-webkit-前缀;而其余高版本浏览器支持标准写法
例子2:
.example2{
width: 200px;
height: 100px;
background-color: blanchedalmond;
/*代表持续时间为2s*/
transition: 2s;
}
.example2:hover{
width: 500px;
}
例子3
.example3{
width: 200px;
height: 100px;
background-color: blanchedalmond;
/*代表持续时间为1s,延迟时间为2s*/
transition: 1s 2s;
}
.example3:hover{
width: 500px;
}
过渡的样式:
不是所有的CSS样式值都可以过渡,只有具有中间值的属性才具备过渡效果
颜色: color background-color border-color outline-color
位置: backround-position left right top bottom
长度:
[1]max-height min-height max-width min-width height width
[2]border-width margin padding outline-width outline-offset
[3]font-size line-height text-indent vertical-align
[4]border-spacing letter-spacing word-spacing
数字: opacity visibility z-index font-weight zoom
组合: text-shadow transform box-shadow clip
其他: gradient 过度持续的时间:
该属性的单位是秒s或者毫秒ms
该属性的默认值为0,但是0无效,必须得带单位 过渡时间函数(transition-timing-function):
过渡时间函数用于定义过渡属性随时间变化的过渡速度变化的效果
默认值是:ease
取值:三种取值,分别是关键字,steps函数,bezier函数
1)steps函数
steps步进函数将过渡时间划分为大小相等的时间间隔来运行
css过渡的更多相关文章
- 深入理解CSS过渡transition
× 目录 [1]定义 [2]过渡属性 [3]持续时间[4]延迟时间[5]时间函数[6]多值[7]阶段[8]触发[9]API 前面的话 通过过渡transition,可以让web前端开发人员不需要jav ...
- Vue过渡效果之CSS过渡
前面的话 Vue 在插入.更新或者移除 DOM 时,提供多种不同方式的应用过渡效果.本文将从CSS过渡transition.CSS动画animation及配合使用第三方CSS动画库(如animate. ...
- 047——VUE中css过渡动作实例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- css过渡和2d详解及案例
css过渡和2d详解及案例(案例在下方,不要着急) 本文重点: 1.在2D变化使用过程中,有些需求需要两种或两种以上的变化同时使用, 值得注意的是尽量把位移变化放在最前面,把其他变化放在最后面,属性值 ...
- Vue css过渡 和 js 钩子过渡
css过渡 <transition name="slide"> <div v-show="!showChatInput" class=&quo ...
- CSS过渡、CSS动画
<!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <script s ...
- 原生js判断css3动画过度(transition)结束 transitionend事件 以及关键帧keyframes动画结束(animation)回调函数 animationEnd 以及 css 过渡 transition无效
上图的 demo 主要讲的 是 css transition的过渡回调函数transitionend事件: css3 的时代,css3--动画 一切皆有可能: 传统的js 可以通过回调函数判断动画 ...
- css 过渡和 变形
一.过渡(transition) transition-property: 指定具有过渡效果的CSS样式属性名 1.默认值: all 2.仅具有中间值(CSS样式值是数值的)的CSS样式具有过渡效果 ...
- CSS过渡动画之transition
O(∩_∩)O~ 这两天在看看CSS的相关内容,关于transition动画感觉很有意思,分享一下. CSS负责给html加效果,自然少不了各种动画,今天介绍一下transition. 概述 看一段比 ...
随机推荐
- 旧调重弹Hibernate与Ibatis区别——深入架构设计
对于一个粗学者而言一言概况就是:ibatis非常简单易学,hibernate相对较复杂,门槛较高. 但是,hibernate对数据库结构提供了较为完整的封装,hibernate的o/r mappin ...
- 论文阅读(Weilin Huang——【arXiv2016】Accurate Text Localization in Natural Image with Cascaded Convolutional Text Network)
Weilin Huang——[arXiv2016]Accurate Text Localization in Natural Image with Cascaded Convolutional Tex ...
- 软件工程实践助教每周小结 < 福州大学 | 傅明建 >
第一周助教小结 1. 助教博客链接: http://www.cnblogs.com/sinceway/ 2. 本周点评的作业数量:约22份,有多次交互 3. 本周点评有困难的作业链接: https:/ ...
- 【转】Powershell与jenkins集成部署的运用(powershell运用)
powershell简介: 远程管理采用的一种新的通信协议,Web Services for Management,简称WS-MAN它通过http或者https进行工作,WS-WAN的实现主要基于一个 ...
- git 使用过程中遇到的问题does not appear to be a git repository Could not read from remote respository
想把本地的git库上传到github上.github已经新建了一个public仓库,利用网站的命令 git Bash报错:does not appear to be a git repository ...
- CSS——img自适应div大小
代码如下: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <tit ...
- html禁止页面滚动
<div @touchmove.prevent></div> @touchmove.prevent //加到标签上禁止滚动
- mySQL简单操作(三)
1.事务 (1)ACID 原子性(不可分割性)automicity 一致性 consistency 隔离性 isolation 持久性 durability (2)事务控制语句 begin/start ...
- 移动端js调试工具:eruda
通常写前端页面都在Chrome浏览器的开发模式下进行调试,但是写放在移动端的H5页面时,有时候会遇到在Chrome上调试没有问题,但是在手机的浏览器上有问题的情况:或者有些功能只能在特定的容器中才能其 ...
- 使用grafana provisioning通过配置方式添加datasource和dashboard
grafana provisioning grafana provisioning (http://docs.grafana.org/administration/provisioning/#prov ...