文本字体属性
- 字体大小(字号):font-size: number px;
- 行高:line-height:number px;
- 没有修饰线:text-decoration:none;
- 字体颜色:color:#000;
- 列表去掉标识符:list-style:none;
- 文本居中:text-align:center;
背景属性
- 颜色:background-color:red;
- 背景图:background-image:url(路径);
边框属性
- Border-style:dotted;(点线)dashed;(虚线)solid;(实线)
- Border-width:px;边框宽度;
- border-color:#000;
- 简写的方法:border:width style color;
尺寸属性(单位是px,vw等等)
- width:?px;
- Height:?px;
- 像素单位是px是绝对单位;
- vw、vh是相对于浏览器的视口的相对单位;
外间距
- 当前元素和其他元素外部之间的距离
- 上外间距:margin-top:?px;
- 右外间距:margin-right:?px;
- 下外间距:margin-bottom:?px;
- 左外间距:margin-left:?px;
内间距
- 当前元素和自己的内部元素或者内容之间的距离。
- 上内间距:padding-top:?px;
- 右内间距:padding-right:?px;
- 下内间距:padding-bottom:?px;
- 左内间距:padding-left:?px;
弹性盒子属性
- 由父元素控制内部的子元素排列布局位置
- 成为弹性盒子:display:flex;
- 项目换行:flex-wrap:wrap;
- 项目主轴居中:justify-content:center;
- 项目主轴靠两端:justify-content:space-between;
- 项目交叉轴居中:align-item:center;