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,75 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>定位</title>
<style>
body {
margin: 0;
height: 3000px;
}
.box {
width: 200px;
height: 200px;
border: 1px solid #000;
box-sizing: border-box;
float: left;
}
.box_1 {
background: rebeccapurple;
position: fixed;
bottom: 0;
right: 0;
}
.box_2 {
background: red;
position: relative;
left: 63px;
top: 31px;
}
.box_3 {
background: green;
}
.box_4 {
background: yellow;
position: relative;
left: -183px;
top: 74px;
}
.box_5 {
background: palevioletred;
}
.box_4_1 {
width: 100px;
height: 100px;
background: peachpuff;
border: 1px solid #000;
box-sizing: border-box;
position: absolute;
left: 13px;
top: 145px;
}
</style>
</head>
<body>
<div class="box box_1"></div>
<div class="box box_2"></div>
<div class="box box_3"></div>
<div class="box box_4">
<div class="box_4_1"></div>
</div>
<div class="box box_5"></div>
</body>
</html>

View File

@@ -0,0 +1,31 @@
定位 position
为了实现更加灵活和自由的布局
left,right,top,bottom
z-index 调整z轴的漂浮等级
1相对定位 relative
当元素被设置相对定位后,它原本位置没有被删除,脱离文档流了
定位参考对象:
是他原本的位置
2绝对定位 absolute
当元素被设置绝对定位后,它原本位置被被删除,脱离文档流了
定位参考对象:
他的父元素如果没有设置定位
参考body边框来定位
他的父元素如果设置了定位
定位参考对象就是父元素的位置
3固定定位 fixed
当元素被设置固定定位后,它原本位置被被删除,脱离文档流了
定位参考对象:就是浏览器的边框