HTML连载65-过渡模块的基本使用

一、过渡模块的基本使用

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大数据学习视频礼包

原文地址:https://www.cnblogs.com/ruigege0000/p/12240755.html

时间: 2024-08-01 05:30:04

HTML连载65-过渡模块的基本使用的相关文章

CSS动画之过渡模块

:hover伪类选择器可以用于所有的选择器(只有在悬停时,执行选择器的属性)CSS3中新增过渡模块:transition property(属性)duration(过渡效果花费的时间)timing-function(过渡效果的时间曲线)delay(过渡效果何时开始)简写:transition:过渡属性 过渡时长 过渡速度 过渡延迟 (!!如果有多组属性要改变则直接用逗号隔开写几组即可)如果有的属性相同则例:all 5s表示都是5s完成三要素:必须属性发生变化 必须告诉系统哪个属性变化 必须告诉系

css过渡模块和2d转换模块

(一)过度模块的三要素: 1.必须要有属性发生变化 2.必须告诉系统哪个属性需要执行过渡效果 3.必须告诉系统过渡效果持续时长 ps:当多个属性需要同时执行过渡效果时用逗号隔开即可 transition-property: width, background-color; transition-duration: 5s, 5s; 示例代码:          过渡模块 效果图:    变化前     变化中     变化后 (二)过渡模块的其它属性: 1.告诉系统延迟多少秒之后才开始过渡动画:t

HTML连载66-过度模块的连写、弹性效果

一.过渡模块的连写 1.过渡连写格式: 过渡属性  过渡时长  运动速度  延迟时间: 2.过渡连写注意点: (1)和分开写一样,如果想要多个属性添加过渡效果,也是使用逗号来隔开即可. (2)连写的时候可以省略后面的两个参数,因为只要编写了前面的两个参数就已经满足了过渡的三要素. (3)如果多个属性运动的速度/延迟的时间/持续的时间都一样,那么可以简写为? transition:all 0s <style> *{ margin:0; padding:0; } div{ width: 100px

CSS3——过渡模块——手风琴案例

1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>CSS3过渡模块-手风琴效果</title> 6 <style> 7 *{margin: 0;padding: 0;} 8 ul{ 9 width: 960px; 10 height: 300px; 11 border: 1p

2D过渡模块的其他属性

官网上关于过渡属性的值: 属性 描述 CSS transition 简写属性,用于在一个属性中设置四个过渡属性. 3 transition-property 规定应用过渡的 CSS 属性的名称. 3 transition-duration 定义过渡效果花费的时间.默认是 0. 3 transition-timing-function 规定过渡效果的时间曲线.默认是 "ease". 3 transition-delay 规定过渡效果何时开始.默认是 0. 3 transition-tim

利用css3过渡模块,写 手风琴效果

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <style> *{ padding:0; margin:0; } ul{ width:960px; height:400px; margin:100px auto; border:1px solid lime; over

常用的基础模块介绍

模块,是用一堆代码来实现某个功能的代码集合类似于函数式编程和面向过程编程,函数式编程则完成一个功能,其他代码来调用该功能,提供了代码的重用性和代码间的耦合性而对于一个复杂的功能,可能需要多个函数才能完成,这些文件组成的代码集合称为模块模块分为三种:自定义模块:内置标准模块:开源模块模块一:datetime和time 1 import time 2 print("返回标准时间(含年月日等信息):",time.asctime()) 3 print("返回本地时间的struct t

transtion:过渡动画

p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Monaco; color: #4f5d66 } p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Monaco; color: #4f5d66; min-height: 22.0px } span.Apple-tab-span { white-space: pre } 动画分为: 1.css3动画:(动画性能远高于js) 1).过渡动

python 各模块

01 关于本书 02 代码约定 03 关于例子 04 如何联系我们 1 核心模块 11 介绍 111 内建函数和异常 112 操作系统接口模块 113 类型支持模块 114 正则表达式 115 语言支持模块 12 _ _builtin_ _ 模块 121 使用元组或字典中的参数调用函数 1211 Example 1-1 使用 apply 函数 1212 Example 1-2 使用 apply 函数传递关键字参数 1213 Example 1-3 使用 apply 函数调用基类的构造函数 122