分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 运营维护

CSS3 transition 属性——逐渐变慢/匀速/加速/减速/加速然后减速

发布时间:2023-09-06 01:13责任编辑:林大明关键词:CSS

transition:all 1s ease 1s

ease:

1、ease:(逐渐变慢)默认值


2、linear:(匀速)

3、ease-in:(加速)

4、ease-out:(减速)

5、ease-in-out:(加速然后减速)

6、cubic-bezier

如:

<!DOCTYPE html><html lang="en"><head> ???<meta charset="UTF-8"> ???<title>Document</title> ???<style type="text/css"> ???????*{margin:0; padding: 0;} ???????.icon_down{ width: 0; height: 0; border-left:20px solid transparent; border-right: 20px solid transparent; border-top:20px solid #B03939; transition: all .1s ease-in 0ms; margin:50px auto; cursor: pointer; } ???????.icon_down:hover{ transform: rotate(180deg);} ???</style></head><body> ???<div class="icon_down"></div></body></html>

效果图:鼠标经过旋转180度,

例子2:

把鼠标指针放到 div 元素上,其宽度会从 100px 逐渐变为 300px:

div{width:100px;transition: width 2s;-moz-transition: width 2s; /* Firefox 4 */-webkit-transition: width 2s; /* Safari 和 Chrome */-o-transition: width 2s; /* Opera */}

效果图:

鼠标经过后

CSS3 transition 属性——逐渐变慢/匀速/加速/减速/加速然后减速

原文地址:http://www.cnblogs.com/huanghuali/p/7572885.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved