CSS 属性表简表,列出了一些我们常用的CSS的属性。
属性名称 属性含义 属性值
字体属性(Font)
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等
颜色和背景属性
Color 定义前景色 颜色
Background-color 定义背景色 颜色
Background-image 定义背景图案 路径
Background-repeat 重复方式 Repeat-x、repeat-y、no-repeat
Background-attachment 设置滚动 Scroll、Fixed
Background-position 初始位置 Percentage、length、top、left、right、bottom等
文本属性
Word-spacing 单词之间的间距 Normal <length>
Letter-spacing 字母之间的间距 Normal <length>
Text-decoration 文字的装饰样式 Noneunderlineoverlineline-throughblink
Vertical-align 垂直方向的位置 Baselinesubsupertoptext-topmiddlebottomtext-bottom
Text-transform 文本转换 Capitalizeuppercaselowercasenone
Text-align 对齐方式 Leftrightcenterjustify
Text-indent 首行的缩进方式 <length><percentage>
Line-height 文本的行高 Normal<number><length><percentage>
边距属性
Margin-top 顶端边距 Lengthpercentageauto
Margin-right 右侧边距 Lengthpercentageauto
Margin-bottom 底端边距 Lengthpercentageauto
Margin-left 左侧边距 Lengthpercentageauto
填充距属性
Padding-top 顶端填充距 Lengthpercentage
Padding-right 右侧填充距 Lengthpercentage
Padding-bottom 底端填充距 Lengthpercentage
Padding-left 左侧填充距 Lengthpercentage
边框属性
Border-top-width 顶端边框宽度 Thinmediumthicklength
Border-right-width 右侧边框宽度 Thinmediumthicklength
Border-bottom-width 底端边框宽度 Thinmediumthicklength
Border-left-width 左侧边框宽度 Thinmediumthicklength
Border-width 一次定义宽度 Thinmediumthicklength
Border-color 设置边框颜色 Color
Border-style 设置边框样式 Nonedotteddashsolid等
Border-top 一次定义顶端 Border-top-widthcolor等
Border-right 一次定义右侧 Border-top-widthcolor等
Border-bottom 一次定义底端 Border-top-widthcolor等
Border-left 一次定义左侧 Border-top-widthcolor等
Width 定义宽度属性 Lengthpercentageauto
上一篇:
absolute 与 relative 的运用
下一篇:
网页设计中利用JS控制网页音乐的代码实例