一、CSS文字属性
字体样式属性 | 功能含义 |
---|---|
color:#999999 | 文字颜色 |
font-family:宋体,sans-serif | 文字字体 |
font-size:9pt | 文字大小 |
font-style:itelic | 文字斜体 |
font-variant:small-caps | 小字体 |
letter-spacing:1pt | 字间距离 |
line-height:200% | 设置行高 |
font-weight:bold | 文字粗体 |
vertical-align:sub | 下标字 |
vertical-align:super | 上标字 |
text-decoration:line-through | 加删除线 |
text-decoration:overline | 加顶线 |
text-decoration:underline | 加下划线 |
text-decoration:none | 删除链接下划线 |
text-indent:30px | 段落首行缩进 |
text-transform:capitalize | 首字大写 |
text-transform:uppercase | 英文大写 |
text-transform:lowercase | 英文小写 |
text-align:right | 文字右对齐 |
text-align:left | 文字左对齐 |
text-align:center | 文字居中对齐 |
text-align:justify | 文字分散对齐 |
对齐方式 | 功能含义 |
---|---|
vertical-align属性vertical-align:top | 垂直向上对齐 |
vertical-align:bottom | 垂直向下对齐 |
vertical-align:middle | 垂直居中对齐 |
vertical-align:text-top | 文字垂直向上对齐 |
vertical-align:text-bottom | 文字垂直向下对齐 |
二、CSS边框属性
margin(外边框)属性 | 功能含义 |
---|---|
margin 简写属性。 | 在一个声明中设置所有外边距属性。 |
margin-bottom | 设置元素的下外边距。 |
margin-left | 设置元素的左外边距。 |
margin-right | 设置元素的右外边距。 |
margin-top | 设置元素的上外边距。 |
border(边框)属性 | 功能含义 |
---|---|
border-style | 用于设置元素所有边框的样式,或者单独地为各边设置边框样式。 |
border-width | 简写属性,用于为元素的所有边框设置宽度,或者单独地为各边边框设置宽度。 |
border-color | 简写属性,设置元素的所有边框中可见部分的颜色,或为 4 个边分别设置颜色。 |
border-bottom | 简写属性,用于把下边框的所有属性设置到一个声明中。 |
border-bottom-color | 设置元素的下边框的颜色。 |
border-bottom-style | 设置元素的下边框的样式。 |
border-bottom-width | 设置元素的下边框的宽度。 |
border-left | 简写属性,用于把左边框的所有属性设置到一个声明中。 |
border-left-color | 设置元素的左边框的颜色。 |
border-left-style | 设置元素的左边框的样式。 |
border-left-width | 设置元素的左边框的宽度。 |
border-right | 简写属性,用于把右边框的所有属性设置到一个声明中。 |
border-right-color | 设置元素的右边框的颜色。 |
border-right-style | 设置元素的右边框的样式。 |
border-right-width | 设置元素的右边框的宽度。 |
border-top | 简写属性,用于把上边框的所有属性设置到一个声明中。 |
border-top-color | 设置元素的上边框的颜色。 |
border-top-style | 设置元素的上边框的样式。 |
border-top-width | 设置元素的上边框的宽度。 |
padding(内边距)属性 | 功能含义 |
---|---|
padding | 使用简写属性设置在一个声明中的所有填充属性 |
padding-bottom | 设置元素的底部填充 |
padding-left | 设置元素的左部填充 |
padding-right | 设置元素的右部填充 |
padding-top | 设置元素的顶部填充 |
三、CSS背景样式
背景样式属性 | 功能含义 |
---|---|
background-color:#F5E2EC | 背景颜色 |
background:transparent | 透视背景 |
background-image:url(/image/bg.gif) | 背景图片 |
background-attachment:fixed | 浮水印固定背景 |
background-repeat:repeat | 重复排列-网页默认 |
background-repeat:no-repeat | 不重复排列 |
background-repeat:repeat-x | 在x轴重复排列 |
background-repeat:repeat-y | 在y轴重复排列,指定背景位置 |
background-position:90%90% | 背景图片x与y轴的位置 |
background-position:top | 向上对齐 |
background-position:buttom | 向下对齐 |
background-position:left | 向左对齐 |
background-position:right | 向右对齐 |
background-position:center | 居中对齐 |
四、CSS连接属性
字体样式属性 | 功能含义 |
---|---|
a | 所有超链接 |
a:link | 超链接文字格式 |
a:visited | 浏览过的链接文字格式 |
a:active | 按下链接的格式 |
a:hover | 鼠标转到链接、鼠标光标样式 |