first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,70 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>定位</title>
<style>
body {
margin: 0;
padding: 0;
}
.box {
width: 200px;
height: 200px;
border: 1px solid #000;
box-sizing: border-box;
float: left;
}
.box_1 {
background: brown;
}
.box_2 {
background: green;
position: relative;
left: 10px;
top: 30px;
}
.box_3 {
background: yellow;
}
.box_4 {
background: blue;
}
.box_4_1 {
width: 100px;
height: 100px;
background: sienna;
position: absolute;
left: 10px;
top: 40px;
}
.box_5 {
background: plum;
}
</style>
</head>
<body>
<div class="box box_1"></div>
<div class="box box_2">
<div class="box_4_1"></div>
</div>
<div class="box box_3"></div>
<div class="box box_4"> </div>
<div class="box box_5"></div>
</body>
</html>

View File

@@ -0,0 +1,25 @@
css 定位:
相对定位
元素设置相对定位后:
不会从文档流删除(脱离),原本位置还在。
定位参考对象:参考原本位置
绝对定位
会从文档流删除(脱离),原本位置不在。
定位参考对象:
父元素有没有定位
1有定位参考元素的初始位置进行定位
2没有定位参考浏览器边框body
固定定位
会从文档流删除(脱离),原本位置不在。
定位参考对象就是浏览器窗口