HTML连载65-过渡模块的基本使用
2024-09-24 08:22:38
一、过渡模块的基本使用
1.*:hover;这个伪类选择器除了可以用在a标签上,还可以用在其他任何标签上。
2.过渡三要素:
(1)必须要有属性发生变化;(2)必须告诉系统哪个属性需要执行过渡效果;(3)必须告诉系统过渡效果持续的时长。
3.注意点:
当多个属性需要同时执行过渡效果的时候,可以使用英文逗号进行隔开。
例如:
transition-property:width,height,background-color;
transition-duration:0.4s,0.8s,4s;
transition-property:width,height,background-color;
transition-duration:0.4s,0.8s,4s;
<style>
*{
margin:0px;
padding:0px;
}
div{
width:100px;
height:50px;
background:red; }
div:hover{
width:300px;
height:300px;
background-color:blue;
/*告诉系统哪个属性将会使用过渡效果*/
transition-property:width,height,background-color;
/*告诉系统这个过渡效果需要持续多久*/
transition-duration:0.4s,0.8s,4s;
}
........省略代码.......
<div>
</div>
二、其他属性
<style>
*{
margin:0px;
padding:0px;
}
div{
width:100px;
height:50px;
background:red; }
div:hover{
width:300px;
height:300px;
background-color:blue;
transition-property:width,height,background-color;
transition-duration:0.4s,0.8s,4s;
transition-delay:2s;
}
ul{
width:800px;
height:500px;
margin:0 auto;
background-color:pink;
}
ul li {
list-style:none;
width:100px;
height:50px;
margin-top:50px;
background-color:green;
transition-property:margin-left;
transition-duration:2s; }
ul:hover li{
margin-left:700px;
}
ul li:nth-child(1){
/*该属性用于控制动画运动速度的*/
transition-timing-function:linear;
}
ul li:nth-child(2){
transition-timing-function:ease;
}
ul li:nth-child(3){
transition-timing-function:ease-in;
}
ul li:nth-child(4){
transition-timing-function:ease-out;
}
ul li:nth-child(5){
transition-timing-function:ease-in-out;
}
......省略代码......
<div>
</div>
<ul>
<li>linear</li>
<li>ease</li>
<li>ease-in</li>
<li>ease-out</li>
<li>ease-in-out</li>
</ul>
三、源码:
D163_ExcessiveModule.html
地址:
https://github.com/ruigege66/HTML_learning/blob/master/ D163_ExcessiveModule.html
2.CSDN:https://blog.csdn.net/weixin_44630050
3.博客园:https://www.cnblogs.com/ruigege0000/
4.欢迎关注微信公众号:傅里叶变换,个人账号,仅用于技术交流,后台回复“礼包”获取Java大数据学习视频礼包
最新文章
- IBM Bluemix体验:Containers进阶
- block,inline和inline-block概念和区别
- CoreData的使用
- mono的Type.GetType(string)总是为空
- LFS7.4编译笔记(2)
- 打造自己的3D全景漫游
- tomcat升级问题
- 发送带有认证信息的HTTP请求并取回响应
- jQuery easyUI框架中经常出现的问题
- &#39;gbk&#39; codec can&#39;t encode character
- [python标准库]Pickle模块
- HDU1305 Immediate Decodability(水题字典树)
- WINDOWS的错误代码对应的故障
- [Leetcode 40]组合数和II Combination Sum II
- DOM表单(复选框)
- WPF中的路由事件(转)
- Pytorch数据读取框架
- An Edge-Guided Image Interpolation Algorithm via Directional Filtering and Data Fusion【翻译】
- Swoole和Swoft的那些事 (Http/Rpc服务篇)
- python学习之路---day19--面向对象--约束