首页 > 其他 > 详细

trasition过度效果

时间:2016-11-24 00:16:42      阅读:334      评论:0      收藏:0      [点我收藏+]

<!DOCTYPE html>

<html>

<head lang="en">

    <meta charset="UTF-8">

    <title></title>

    <style>

        body{

            font-family: myfamily;

            font-size: 20px;

        }

        @font-face {

            font-family: myfamily;    /*字体自定义名称,便于引用*/

            /*自定义字体

            */

            src:url("res/font.TTF");

            /*字体的url*/

        }


        p{

            transition: 500ms;

            font-family: myfamily;

            font-size: 20px;

            position: relative;

            top: 200px;

            left: 100px;

        }

        

        p:hover{

            font-size: 70px;

            color: aquamarine;

        }

        div{

              width: 400px;

              height: 200px;

              background-color: lavenderblush;

              transition: width 2s linear  ;                        /*宽度过度时间为2s,匀速*/


        }

        div:hover{

            width: 600px;


        }

        #div2{

            text-align: center;

            margin: auto;

        line-height: 20px;;

            font-size: 2px;

            width: 50px;;

            height: 20px;;

            background-color: antiquewhite;

            transition:1s;                            /*只改变了背景色,过度时间为1s*/

        }

        #div2:hover{

            background-color: coral;

        }

    </style>

</head>

<body>


    <div id="div1">


    </div>

    <div id="div2">

            红米2

    </div>


</body>

</html>


本文出自 “matengbing” 博客,请务必保留此出处http://matengbing.blog.51cto.com/11395502/1875885

trasition过度效果

原文:http://matengbing.blog.51cto.com/11395502/1875885

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!