常见css属性总结


文字属性

字体:font                  文本缩进:text-index

文本字体:font-family            文本大小写:text-transform

文本字号:font-size             文本不换行:white-space

文本字体样式:font-style            文本溢出裁切:text-overflow

文本字体粗细:font-weight         文本下划线:text-decoration

文本字体行高:line-height          文本阴影:text-shadow

内容水平对齐:text-align          颜色:color  


边框属性

边框:border

上/下/左/右边框:border-top/bottom/left/right

圆角边框:border-radius

阴影:box-shadow


尺寸属性

固定宽高:width/height            溢出方式:overflow

最大/最小宽度:max/min-width          横向溢出:overflow-x

最大/最小高度:max/min-height           纵向溢出:overflow-y


背景属性

背景:background

背景颜色:background-color

背景图像:background-image

铺排填充:background-repeat

滚动固定:background-attachment

背景图片位置:background-position

背景尺寸大小:background-size


盒子阴影

外边距/外间距/外补白:margin

外上/下/左/右边距:margin-top/bottom/left/right

内边距/内间距/内补白:padding

内上/下/左/右边距:padding-top/bottom/left/right

浮动:float

清除浮动:clear

显示方式:display


伪类属性:

默认链接状态:  :link(a:link)

访问过的链接:  :visited(a:visited)

正在活动的链接:  :active(a:active)

触发的状态: :hover(a:hover)

输入框焦点: :focus(input:focus)


css3新增:

前插入内容::before(p:before)

后插入内容: :after(p:after)

插入元素:content

首个子元素::first-child

该类型首个子元素: :first-of-type

父级第N个子元素: :nth-child

该类型第N个子元素:  :nth-of-type

最后子元素: :last-child

该类型最后子元素:  :last-of-type


定位属性

定位方式:position

上边界向下偏移:top

下边界向上偏移:bottom

左边界向右偏移:left

右边界向左偏移:right

层叠顺序:z-index


媒体查询:mediaCSS

重定义浏览器默认样式:css reset


其他样式

列表样式:list-style

表格:table

鼠标手势:cursor

不透明度:opacity

轮廓:outline

滚动条:scrollbar