前端Css属性总结
width: 设置宽度;
height: 设高度;
background-color: 设置背景颜色;
border:边框;
border-radius: 边角 ;
字体
color:设置字体颜色;
font-size:设置字体大小;
font-weight:文字是否加粗 值100-1000 ;
font-style:设置字体样式;
font-family: 设置使用那种字体;
line-height:设置行高;
外边距 内边距
margin:外边距 第一个值上下 第二个值左右 列文本居中 0 atuo;
padding:内边距 ;
浮动
float:left; 左浮动
float:left; 右浮动
浮动会让标签脱离文本流
清除浮动代码
.clearfix::before,
.clearfix::after {
content: “”;
display: table;
}
.clearfix::after {
clear: both;
}
.clearfix {
*zoom: 1;
}
display属性
display: inline;转行块
display:block;转块
display: inline-block;转行内块
display:flex;开启弹性布局
定位
position: relative;相对定位
position: absolute;绝对定位
position: fixed;可视区定位
position: sticky;粘性定位
开启绝对定位要在父元素开启相对定位
自己的一点小总结,欢迎让我更改!