老师,为什么我这个小黄鸭移动不了?

来源:2-9 自由编程

阿山123

2021-02-10 11:43:08

<!DOCTYPE html>

<html lang="en">


<head>

    <meta charset="UTF-8">

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

    <title>Document</title>

    <style>

        * {

            padding0;

            margin0;

        }

        .box{

            width300px;

            margin30px auto;

            positionrelative;

            height240px;

            overflowhidden;

        }

        .box img{

            height240px;

            width300px;

        }

        .box .pp{

            background-colorrgba(0000.507);

            colorblanchedalmond;

            width290px;

            height25px;

            line-height25px;

            padding-left10px;

            positionabsolute;

            bottom0;

            margin-bottom-25px;

        

        }

        .box:hover  .pp{

            bottom0;

            margin-bottom-25px;

        }

    </style>

</head>


<body>

    <div class="box">

        <img src="http://127.0.0.1:5500/images_stars/duck.png" alt="">

        <p class="pp">我是小黄鸭</p>

    </div>

</body>


</html>


写回答

2回答

好帮手慕言

2021-02-10

自己找到问题并解决了,很棒,给你点赞,继续加油,祝学习愉快~

0

阿山123

提问者

2021-02-10

老师,不用了,我自己解决了

0

0 学习 · 15276 问题

查看课程