webveuje/csspress/demo2/relative.html

35 lines
628 B
HTML
Raw Permalink Normal View History

2021-01-18 18:11:23 +08:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
}
2021-01-18 18:34:44 +08:00
div{
width: 60px;
height: 60px;
2021-01-18 18:11:23 +08:00
}
.box1 {
background: yellow;
}
.box2 {
background: red;
2021-01-18 18:34:44 +08:00
position: relative;
top: 20px;
left: 30px;
2021-01-18 18:11:23 +08:00
}
</style>
</head>
<body>
<div class="box1">暖暖</div>
<div class="box2"></div>
</body>
</html>