<!Doctype html>
<html>
<head>
<meta charset="utf-8">
<title>this is the title</title>
<style>
.square{
width: 200px;
height: 200px;
background: #ccc;
position: relative;
top: 400px;
left: 400px;
}
.heart{
width: 54px;
height: 61px;
background-image: url(logo.png);
/* position: absolute;
top: 400px;
left: 400px;*/
}
.inner{
width: 50px;
height: 50px;
background: red;
position: absolute;
background: #ccc;
/*background-image: url(logo.png);*/
top: 400px;
left: 400px;
}
span{
width: 50px;
height: 50px;
background: red;
position: absolute;
background:yellowgreen;
/*background-image: url(logo.png);*/
top: 100px;
left: 100px;
}
</style>
</head>
<body>
<div class="square">
<div class="heart">
<div class="inner"></div>
<span>hello</span>
</div>
</div>
</body>
</html>
相对定位和绝队定位
最新推荐文章于 2023-06-26 15:12:05 发布