dmz社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 701|回复: 0

[Html/Css] HTML连载65-过渡模块的基本使用

[复制链接]
  • TA的每日心情

    2024-2-20 11:15
  • 签到天数: 11 天

    [LV.3]偶尔看看II

    878

    主题

    4343

    帖子

    3995

    积分

    终身会员[A]

    Rank: 7Rank: 7Rank: 7

    积分
    3995

    发表于 2020-3-29 12:00:05 | 显示全部楼层 |阅读模式

    本站资源全部免费,回复即可查看下载地址!

    您需要 登录 才可以下载或查看,没有帐号?立即注册

    x
    一、过渡模块的基本使用
    1.*:hover;这个伪类选择器除了可以用在a标签上,还可以用在其他任何标签上。
    2.过渡三要素:
    (1)必须要有属性发生变化;(2)必须告诉系统哪个属性需要执行过渡效果;(3)必须告诉系统过渡效果持续的时长。
    3.注意点:
    当多个属性需要同时执行过渡效果的时候,可以使用英文逗号进行隔开。
    例如:
    transition-property:width,height,background-color;
    transition-duration:0.4s,0.8s,4s;

    [HTML] 纯文本查看 复制代码
    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>


    640.gif


    二、其他属性

    [HTML] 纯文本查看 复制代码
    <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>


    333.jpg

    三、源码:D163_ExcessiveModule.html


    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|Archiver|小黑屋|本站代理|dmz社区

    GMT+8, 2025-2-2 04:54 , Processed in 0.130574 second(s), 34 queries .

    Powered by Discuz! X3.4 Licensed

    Copyright © 2001-2021, Tencent Cloud.

    快速回复 返回顶部 返回列表