老师检查一下

来源:2-7 编程练习

慕九州8176055

2019-10-15 10:47:56

<!DOCTYPE html>

<html>

    <head>

        <meta charset="UTF-8">

        <title>background-origin</title>

        <style>

         div{

         width: 200px;

         height: 150px;

         border: 10px solid skyblue;

         padding:20px;

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

         background-clip: padding-box;

         background-size: cover;

         }

         div:hover{

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

         background-size: cover;

         background-clip: border-box;

         background-origin: content-box;

         }

        </style>

    </head>

    <body>

     <div>

     

     </div>

    </body>

</html>


写回答

1回答

好帮手慕夭夭

2019-10-15

你好同学,建议调整一下宽度,和填充,以及设置一个带有透明度的边框,会让效果更好看,如下:

http://img.mukewang.com/climg/5da5392e09bc712a08480272.jpg

祝学习愉快,望采纳。

0

0 学习 · 40143 问题

查看课程