请问老师为什么箭头没有跳动?

来源:3-8 过渡和变形在实战中的应用(1)

慕仔3411021

2021-04-10 16:42:41

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>慕云游</title>

    <!-- 关键词 -->

    <meta name="Keywords" content="">

    <!-- 描述 -->

    <meta name="Description" content="">

    <!-- css样式 -->

    <style>

    ​    ​    ​

/* 机酒自由行 */

.common-style{

    height698px;

    min-width1152px;

    padding-top40px;

}

.common-style .center-wrap .top h2{

    floatleft;

}

.content-part .center-wrap .top{

    margin-bottom32px;

}

.content-part .center-wrap .top>ul{

    floatright;

    margin-top12px;

}

.content-part .center-wrap .top>ul>li{

    floatleft;

    height22px;

    line-height22px;

    margin-right16px;

    font-size14px;

}

.content-part .center-wrap .top>ul>li:last-child{

    margin-right0;

}

content-part .center-wrap .top>ul>li a{

    colorrgba(0,0,0,0.85);

}

.content-part .center-wrap .top>ul>li.current{

    border-bottom4px solid #20BD9A;

}

.content-part .center-wrap .top>ul>li.current a{

    color#20BD9A;

}

.common-style .center-wrap>ul{

    height612px;

}

.common-style .center-wrap>ul>li{

    floatleft;

    margin-right32px;

    margin-bottom32px;

    box-shadow0 4px 8px 0 rgba(0,0,0,0.08);

    overflowhidden;

}

.common-style .center-wrap>ul>li:hover{

    box-shadow0 8px 16px 0 rgba(0,0,0,0.20);

}

.common-style .center-wrap>ul>li:nth-child(3),

.common-style .center-wrap>ul>li:nth-child(7){

    margin-right0;

}

.common-style .center-wrap>ul>li.big-grid{

    width560px;

    height270px;

    positionrelative;

}

.common-style .center-wrap>ul>li img{

    transition: transform .4s ease 0s;

}

.common-style .center-wrap>ul>li img:hover{

    transformscale(1.1);

}

.common-style .center-wrap>ul>li.big-grid .js{

    positionabsolute;

    bottom0;

    left0;

    width560px;

    height103px;

    background-colorrgba(0,0,0,0.50);

    colorwhite;

    font-size14px;

    padding30px 26px;

    box-sizingborder-box;

}

.common-style .center-wrap>ul>li.pro-grid{

    width264px;

    height270px;

}

.common-style .center-wrap>ul>li.pro-grid .pic{

    width264px;

    height184px;

    overflowhidden;

}

.content-part .center-wrap .more-grid{

    width264px;

    height270px;

    padding-top46px;

    box-sizingborder-box;

    box-shadow0 4px 8px 0 rgba(0,0,0,0.08);

}

.common-style .center-wrap>ul>li .word{

    padding20px 14px 22px;

    font-size14px;

    color#1C1F21;

    line-height22px;

}

.common-style .center-wrap>ul>li em{

    positionabsolute;

    left0;

    bottom103px;

    width74px;

    height40px;

    line-height40px;

    background-colorrgba(0,0,0,0.50);

    colorwhite;

    font-size14px;

    text-aligncenter;

}

.common-style .center-wrap>ul>li.pro-grid .pic{

    positionrelative;

    width264px;

    height184px;

    box-sizingborder-box;

}

.common-style .center-wrap>ul>li.pro-grid em{

    bottom0;

}

.content-part .center-wrap .more-grid{

    background-imagelinear-gradient(180deg#34E3BC 0%#15AF7A 98%);

}

.content-part .center-wrap .more-grid .more-word{

    width236px;

    height44px;

    margin0 auto;

    margin-bottom28px;

    text-aligncenter;

    colorwhite;

    font-size14px;

    line-height22px;

}

.content-part .center-wrap .more-grid .iconfont{

    font-size48px;

    colorwhite;

    positionrelative;

    left108px;

}

/* 鼠标移动到该盒子箭头跳动 */

.content-part .center-wrap .more-grid:hover .iconfont{

    animation: td .4s ease 0s infinite alternate;

}

@keyframes td{

    from{

        transformtranslateY(10px);

    }

    to{

        transformtranslateY(-10px);

    }

}

.content-part .center-wrap .more-grid ul{

    padding-left57px;

    margin-top36px;

    height16px;

}

.content-part .center-wrap .more-grid ul li{

    floatleft;

    colorwhite;

    font-size14px;

    height16px;

    line-height16px;

    border-right1px solid #fff;

    padding0 5px;

}

.content-part .center-wrap .more-grid ul li:last-child{

    border-rightnone;

}

    ​</style>

</head>

<body>

 <!-- 机酒自由行 -->

    <section class="jjzyx content-part common-style">

        <div class="center-wrap">

            <div class="top clearfix">

                <h2>机酒自由行</h2>

                <span>挑选全球机票、酒店、邮轮等旅行产品</span>

                <ul>

                    <li class="current"><a href="#">近期好货</a></li>

                    <li><a href="#">新品汇聚</a></li>

                    <li><a href="#">订制游</a></li>

                    <li><a href="#">近期好货</a></li>

                    <li><a href="#">近期好货</a></li>

                    <li><a href="#">近期好货</a></li>

                    <li><a href="#">近期好货</a></li>

                </ul>

            </div>

            <ul>

                <li class="big-grid">

                    <a href="#">

                        <img src="images/jjzyx1.png" alt="">

                    </a>

                    <div class="js">

                        <p>[樱花季]天津直飞东京/大阪/名古屋/冲绳/札幌2-30天往返</p>

                        <p>含税机票【甩尾/多团期】</p>

                    </div>

                    <em>机票</em>

                </li>

                <li class="pro-grid"><a href="#">

                    <div class="pic">

                        <img src="images/jjzyx2.png" alt="">

                        <em>跟团游</em>

                    </div>

                    <div class="word">

                        北京/上海/南京/杭州直飞巴厘岛5-7天往返含税机票(赠送旅游意外险…

                    </div>

                </a></li>

                <li class="pro-grid"><a href="#">

                    <div class="pic">

                        <img src="images/jjzyx3.png" alt="">

                        <em>机票</em>

                    </div>

                    <div class="word">

                        北京/上海/南京/杭州直飞巴厘岛5-7天往返含税机票(赠送旅游意外险…

                    </div>

                </a></li>

                <li class="pro-grid"><a href="#">

                    <div class="pic">

                        <img src="images/jjzyx4.png" alt="">

                        <em>机票</em>

                    </div>

                    <div class="word">

                        北京/上海/南京/杭州直飞巴厘岛5-7天往返含税机票(赠送旅游意外险…

                    </div>

                </a></li>

                <li class="pro-grid"><a href="#">

                    <div class="pic">

                        <img src="images/jjzyx5.png" alt="">

                        <em>机票</em>

                    </div>

                    <div class="word">

                        北京/上海/南京/杭州直飞巴厘岛5-7天往返含税机票(赠送旅游意外险…

                    </div>

                </a></li>

                <li class="pro-grid"><a href="#">

                    <div class="pic">

                        <img src="images/jjzyx6.png" alt="">

                        <em>机票</em>

                    </div>

                    <div class="word">

                        北京/上海/南京/杭州直飞巴厘岛5-7天往返含税机票(赠送旅游意外险…

                    </div>

                </a></li>

                <li class="more-grid"><a href="#">

                    <div class="more-word">

                        <p>查看更多</p>

                        <p>机酒自由行产品</p>

                    </div>

                    <i class="iconfont">&#xe663;</i>

                    <ul>

                        <li>机票</li>

                        <li>酒店</li>

                        <li>机+酒</li>

                        <li>游轮</li>

                    </ul>

                </a></li>

            </ul>

        </div>

    </section>

</body>

写回答

1回答

好帮手慕久久

2021-04-10

同学你好,解答如下:

transform这个属性比较特殊,它对具有display:inline;性质的元素无效。由于i标签是一个inline元素:

http://img.mukewang.com/climg/60716a9209ce35ff09760550.jpg

所以会没有动画效果。

可以通过将其转成块级元素来解决问题:

http://img.mukewang.com/climg/60716b5e09c0df0407100220.jpg

祝学习愉快!



1

0 学习 · 15276 问题

查看课程