老师检查一下
来源: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
你好同学,建议调整一下宽度,和填充,以及设置一个带有透明度的边框,会让效果更好看,如下:

祝学习愉快,望采纳。
相似问题