CSS的各种属性
属性 | 属性含义 | 属性值 |
font-family | 使用什么字体 | 所有字体 |
font-style | 字体是否斜体 | Normal, italic, oblique |
font-variant | 字体是否用小体大写 | Normal, small-caps |
font-weight | 定义字体的粗细 | Normal, bold, bolder, lithter |
font-size | 定义字体的大小 | Absolute-size, relative-size, length, percentage |
属性 | 属性含义 | 属性值 |
word-spacing | 各个单词之间的间距 | Normal <length> |
letter-spacing | 每个字母之间的间距 | 同上 |
text-decoration | 定义文字的装饰样式 | none|underline|overline|line-through|blink |
vertical-align | 元素在垂直方向上的位置 | baseline|sub|super|top|text-top|middle|bottom|text-bottom|<percentage> |
text-transform | 使文本转换为其他的形式 | capitalize|uppercase|lowercase|none|left|right|center|justify |
text-align | 文字对齐的方式 | left|right|center|justify |
text-indent | 文本的首行的缩进方式 | <lenght>|<percentage> |
line-height | 文本的行高 | Normal|<number>|<length><percengage> |
属性 | 属性定义 | 书写格式 | 属性值 |
Color | 定义前景色 | P { color: red} | 颜色 |
background-color | 定义背景色 | body {background-color: yellow} | 颜色 |
background-image | 定义背景图案 | body {backgground-image:url(.jpg) | 图片路径 |
background-repeat | 背景图案重复方式 | body {background-repeat:repeat-y} | repeat-x, repeat-y, no-repeat |
backgound-attachment | 设置滚动 | body {background-attachment:scroll} | scroll, fixed |
background-position | 背景图案的初始位置 | body {background:url(.jpg)top center} | percentage, length, top, left, right, bottom |