css属性列表

206 阅读2分钟

字体属性

属性名称属性含义属性值
字体属性(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字母之间的间距同上
Text-decoration文字的装饰样式None,underline,overline,line-through,blink
Vertical-align垂直方向的位置Baseline,sub,super,top,text-top,middle,bottom,text-bottom,
Text-transform文本转换Capitalize,uppercase,lowercase,none
Text-align对齐方式Left,right,center,justify
Text-indent首行的缩进方式<ength>,<percentage>
Line-height文本的行高Normal,<number>,<length>,<percentage>

边距属性

属性名称属性含义属性值
边距属性
Margin-top顶端边距Length,percentage,auto
Margin-right右侧边距同上
Margin-bottom底端边距同上
Margin-left左侧边距同上

填充距属性

属性名称属性含义属性值
填充距属性
Padding-top顶端填充距Length,percentage
Padding-right右侧填充距卮上
Padding-bottom底端填充距同上
Padding-left左侧填充距同上

边框属性

属性名称属性含义属性值
边框属性
Border-top-width顶端边框宽度Thin,medium,thick,length
Border-right-width右侧边框宽度同上
Border-bottom-width底端边框宽度同上
Border-left-width左侧边框宽度同上
Border-width一次定义宽度同上
Border-color设置边框颜色Color
order-style设置边框样式None,dotted,dash,solid等
Border-top一次定义顶端Border-top-width,color等
Border-right一次定义右侧同上
Border-bottom一次定义底端同上
Border-left一次定义左侧同上
Width定义宽度属性Length,percentage,auto
Height定义高度属性Length,auto
Float文字环绕Leftjright,none
Clear哪一边环绕Left,right,none,both

分级属性

属性名称属性含义属性值
分级属性
Display定义是否显示Block,inline,list-item,none
White-space怎样处理空白Normal,pre,nowrap
List-style-type加项目编号Disc,circle,square等
List-style-image加图案<url>,none
List-style-position第二行起始位置lnside、outside
List-style一次定义列表<keyword><position><url>

鼠标属性

属性名称属性含义属性值
鼠标(Cursor)属性
自动Auto
定位“十”字Crosshair
默认指针Default
手形Hand
移动Move
箭头朝右方e-resize
箭头朝右上方Ne-resize
箭头朝左上方Nw-resize
箭头朝上方n-resize
箭头朝右下方Se-resize
箭头朝左下方Sw-resize
箭头朝下方s-resize
箭头朝左方w-resize
文本“I”形Text
等待Wait
帮助Help