Web前端学习笔记3(filter,transition,transtion应用,进度条,calc())

filter:

1、数值越大越模糊

        img{
            /* //数值越大,越模糊,要跟上单位px */
            filter: blur(5px);
        }
        img:hover{
            /* 鼠标经过不模糊 */
            filter: blur(0px);
        }

transition:

transition: 变化属性,花费时间(单位为s) 运动曲线(默认为ease) 何时开始

运动曲线和何时开始可以省略

谁做过渡给谁加

加逗号,两个进行变换

transition: width 1s, height 1s;

如果想要多个属性都变换,用all

        div{
            width: 200px;
            height: 100px;
            background-color: pink;
            /* transition: 变化属性,花费时间(单位为s) 运动曲线(默认为ease) 何时开始; */
            /* 运动曲线和何时开始可以省略 */
            /* 加逗号,两个进行变换 */
            /* transition: width 1s, height 1s; */
            /* 如果想要多个属性都变换,用all */
            /* 谁做过渡给谁加 */
            transition: all 1s;
        }
        div:hover {
            width: 400px;
            height: 300px;
            background-color: skyblue;
        }

transtion应用,进度条

        .bar {
            width: 150px;
            height: 15px;
            border: 1px solid red;
            border-radius: 7px;
            padding: 1px;
        }
        .bar_in{
            width: 50%;
            height: 100%;
            background-color: red;
            transition: width 1s;
        }
        .bar_in:hover{
            width: 100%;
        }

calc():

        .father{
            width: 300px;
            height: 200px;
            background-color: pink;
        }
        .child{
            /* 用calc函数可以计算 */
            width: calc(100%-30px);
            height: 30px;
            background-color: red;
        }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值