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回答
同学你好,根据第二次的代码,实现的正确哦。继续加油,祝学习愉快~
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>
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>相似问题