效果图:
通过三个div设置,img标签不可以嵌套标签。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
*{
margin: 0px;
padding: 0px;
}
#div{
margin: 100px auto;
width: 480px;
height: 331px;
background-image: url("12.jpg");
}
#div1{
width: 112px;
height: 113px;
background-image: url("已添加.png");
float: right;
}
#div2{
background-image: url("喜欢-按下.png");
width: 45px;
height: 40px;
float: right;
/*position: relative;*/
/*top: 286px;*/
/*left: 100px;*/
margin-top: 286px;
margin-right: -100px;
}
</style>
</head>
<body>
<div id="div">
<div id="div1"></div>
<div id="div2"></div>
</div>
</body>
</html>