5.12 (案例) width

width.png
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>skew</title>
    <style type="text/css">
    div{
        width:300px;
        height: 200px;
        background: -webkit-linear-gradient(left,orange 30%,red 100%);
        margin: 50px;
    }
    div:nth-child(2){
        background: #fff;
        border:1px solid orange;
    }
    div:hover{
/*      width: 500px;
        height: 400px;

*/      
/*transform: translate(300px);*/
        border-color:#ccc;
    }   
    /*过渡绝对不能写在hover里面*/
    div:nth-child(2){
        transition-property:all;
        transition-duration:0.8s;
        transition-timing-function:ease-in-out;
        transition-delay:0s;
    }
    </style>
</head>
<body>
    <div></div>
    <div></div>
</body>
</html>
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容