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,42 @@
<!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>
* {
margin: 0;
padding: 0;
list-style: none;
}
ul {
display: flex;
align-items: center;
height: 40px;
justify-content: space-around;
}
ul li {}
</style>
</head>
<body>
<ul>
<li>首页1</li>
<li>首页2</li>
<li>首页3</li>
<li>首页4</li>
<li>首页5</li>
<li>首页6</li>
<li>首页7</li>
<li>首页8</li>
<li>首页9</li>
<li>首页10</li>
</ul>
</body>
</html>

View File

@@ -0,0 +1,44 @@
弹性盒子
主要用来实现布局的兼容
13个css属性
display: flex 开启弹性盒子 加载父元素上
父元素上6个
justify-content设置元素在X轴上的对齐方式
space-between space-around center
align-items: 设置单根轴线(x轴) 元素在Y轴上的对齐方式
center
多根 align-content
flex-wrap: wrap; 一行放不下的时候,进行换行
flex-direction 设置元素排列方向,
如果设置columnjustify-content 和 align-items 作用交换
flex-flow: 是 <flex-direction> || <flex-wrap> 简写
子元素上6个
flex-grow 设置元素所占的空间比例(放大)
flex-shrink 设置为0表示不挤压元素的空间一般做横向滑动配合overflow-x
flex 属性是flex-grow, flex-shrink 和 flex-basis的简写默认值为0 1 auto。后两个属性可选。
一般都写一个属性,即表示 flex-grow
align-self 允许某个元素 不遵守父元素上的 align-items 规则
order 设置元素的位置,数值越小越靠前
尺寸兼容
rem
html上的font-size 16px
你写的单位rem * 基准数值 = 真实的尺寸
1: 媒体查询
2: js 实现