CSS基本属性
背景属性
background-color
background-image
- URL()插入图片链接
background-repeat
no-repeat/repeat/repeat-x/repeat-y;
不平铺/平铺/横向平铺/纵向平铺
background-attachment
scroll/fixed
图片随文本内容滚动/不滚动
background-position
参数 X Y
定位图片位置(left/center/right)/(top/center/bottom)
文本属性
color
- 设置文本颜色
letter-spacing
- 设置行内字符间距
line-height:
- 设置行间距
text-align
- 设置对齐方式(left/center/right)
text-decoration
设置文本样式
下划线/删除线/上划线(underline/line-through/overline)
text-indent
- 设置文本首行缩进
texttransform
设置文本大小写转换
每个单词首字母大写/转换为大写/转换为小写
capitalize/uppercase/lowercase
font-size
- 不解释
font -family
字体风格设置
汉字:宋体,黑体,楷体……
英文:Times New Roman,Arial
边框属性
border-style
设置边框样式
黑色实线/双线(中间距离等于border-width)/指定颜色的线(由border-color指定)/菱形边框/3D凹边/3D凸边
solid/double/grove/ridge/inset/outset
border-color
border-width
border-top/right/bottom/left
- 设置某边的连续多条属性
border
- 设置四边的连续多条属性
外边距与内边距
margin
设置外边距
可直接设置像素亦可
margin:0 auto
表示上下外边距为0,左右居中
margin-top/right/bottom/left
- 与上类似
padding-top/right/bottom/left
- 与上类似
列表属性
list-style-image:URL()
改变列表图标
该属性只是只是插入自己设置的图案,并没有取消原来默认的图案必须与list-style:none 连用如:
ul{list-style:none;/*定义ul标签下的列表不显示原有样式*/}
li{list-style-image:url();}
list-style-position
outside设置标记不在文本内容里,且文本内容不与其对齐
inside ……
list-style-type
改变符号排序样式
- disc 实心圆
- circle 空心圆
- square 实心方块
- decimal 阿拉伯数字
- lower-roman 小写罗马数字i ii iii
- upper-roman 大写罗马数字I II III
- lower-alpha 小写英文字母 a b c
- upper-alpha 大写英文字母 A B C
- none 不使用项目符号