css选择器
优先级:id>class>标签
/* 属性名,属性名 =属性值(正则)
= 绝对等于
*= 包含这个元素
^= 以这个开头
$= 以这个结尾
text-align: 排版,居中
text-indent: 2em , 段落首行缩进
行高和块的高度一致,就可以上下居中
vertical-align:middle 文本图片水平对齐
伪类
a:hover{} 鼠标悬浮的样式
a:active{} 鼠标按住的样式
margin: 外边距
padding: 内边距
border: 边框
border-radius: 圆角边框
box-shadow : 盒子阴影
浮动
display :
– block : 块元素
– inline : 行内元素
–inline-block : 既是行内元素也是块状元素
– null : 消失
float :
–left
–right
clear :
–right :右侧不允许有浮动元素
–both :两侧不允许有浮动元素
–none :
overflow : hidden 父级元素边框塌陷
定位
相对定位:相对于原来的位置进行偏移
position:relative ;
绝对定位:基于浏览器或者父级元素
position: absolute;
position: fixed; 固定定位
z-index 默认是0,最高999,层级结构