麻烦老师检查下代码谢谢

来源:2-9 自由编程

菜鸟瑞

2021-03-17 13:10:30

<!DOCTYPE html>

<html lang="en">


<head>

    <meta charset="UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

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

    <title>Document</title>

    <style>

        *{

            padding0;

            margin0;

        }

        .box{

            width1200px;

            height244px;

            margin10px auto;

            border1px solid #000;

        }

        .box ul{

            list-stylenone;

            overflowhidden;

        }

        .box ul li{

            floatleft;

            width300px;

            height244px;

            margin-right100px;

            positionrelative;

        }

        .box ul li .info{

            width300px;

            height30px;

            background-colorrgba(1212120.5);

            positionabsolute;

            colorrgb(023679);

            line-height30px;

            text-aligncenter;

            bottom-30px;

            opacity0;

            transitionall 1s linear 0s;

        }

        .box ul li:hover .info{

            opacity1;

            bottom0;

        }

    </style>

</head>


<body>

    <div class="box">

        <ul>

            <li>

                <img src="/duck.png" alt="">

                <div class="info">大黄鸭</div>

            </li>

            <li>

                <img src="/duck.png" alt="">

                <div class="info">小黄鸭</div>

            </li>

            <li>

                <img src="/duck.png" alt="">

                <div class="info">小小鸭</div>

            </li>

        </ul>

    </div>

</body>


</html>


写回答

1回答

好帮手慕星星

2021-03-17

​同学你好,代码实现效果很棒,没问题。继续加油,祝学习愉快!

1

0 学习 · 15276 问题

查看课程