2-7 编程练习作业提交

来源:2-7 编程练习

MiMicccc

2020-09-08 15:40:37

<!DOCTYPE html>
<html>
    <head lang="en">
        <meta charset="UTF-8">
        <title>background-origin</title>
        <style>
            div {
                width: 300px;
                height: 100px;
                padding: 20px;
                border: 10px solid purple;
                background: url('http://climg.mukewang.com/582c342b0001fd6507000210.jpg') no-repeat top left;
                background-origin: border-box;
            }
            div:hover {
                background: url('http://climg.mukewang.com/582c34220001091605000150.jpg') no-repeat 10px 10px;
                background-origin: padding-box;
            }
        </style>
    </head>
    <body>
        <div></div>
    </body>
</html>


写回答

3回答

好帮手慕夭夭

2020-09-08

同学你好,根据第二次的代码,实现的正确哦。继续加油,祝学习愉快~

0

MiMicccc

提问者

2020-09-08

老师看这个代码


<!DOCTYPE html>

<html>

    <head lang="en">

        <meta charset="UTF-8">

        <title>background-origin</title>

        <style>

            div {

                width: 300px;

                height: 100px;

                padding: 20px;

                border: 10px solid purple;

                background: url('http://climg.mukewang.com/582c342b0001fd6507000210.jpg') no-repeat top left;

                background-origin: padding-box;

            }

            div:hover {

                background: url('http://climg.mukewang.com/582c34220001091605000150.jpg') no-repeat 10px 10px;

                background-origin: content-box;

            }

        </style>

    </head>

    <body>

        <div></div>

    </body>

</html>



0

MiMicccc

提问者

2020-09-08

老师看这个代码


<!DOCTYPE html>
<html>
    <head lang="en">
        <meta charset="UTF-8">
        <title>background-origin</title>
        <style>
            div {
                width: 300px;
                height: 100px;
                padding: 20px;
                border: 10px solid purple;
                background: url('http://climg.mukewang.com/582c342b0001fd6507000210.jpg') no-repeat top left;
                background-origin: padding-box;
            }
            div:hover {
                background: url('http://climg.mukewang.com/582c34220001091605000150.jpg') no-repeat 10px 10px;
                background-origin: content-box;
            }
        </style>
    </head>
    <body>
        <div></div>
    </body>
</html>


0

0 学习 · 40143 问题

查看课程