【学习笔记】1 CSS样式

CSS样式 

1 背景

background

background-color

background-image

background-repeat

background-position

background-attachment:背景关联即背景图像是固定的or不固定的

备注:所有的背景属性都不能继承

2 文本

color

direction:文本左右方向

text-indent:文本缩进,有继承性,块级元素可用该属性,行内元素、图像之类的替换元素不可用该属性

text-align:文本对齐

text-transform:文本大小写

text-decoration:none/underline/overline/line-through/blink(文本闪烁),1个元素匹配2个不同的装饰 进行替换操作而非叠加

line-height

word-spacing:字/单词间隔

letter-spacing:字符/字母间隔

white-space:处理空白符

下面的表格总结了 white-space 属性的行为

空白符 换行符 自动换行
pre-line 合并 保留 允许
normal 合并 忽略 允许
nowrap 合并 忽略 不允许
pre 保留 保留 不允许
pre-wrap 保留 保留 允许

3 字体

font

font-size

font-family

font-style:字体风格倾斜,normal/italic/oblique

font-weight:字体粗细

font-variant:小型大写字体

4 为链接添加样式

a.类名:link 链接未被点击

a.类名:visited 链接已被点击

a.类名:hover 鼠标指针位于链接上方

a.类名:active 链接被点击的时刻

备注:次序规则为a:link、a:visited后a:hover,a:hover后a:active

5 列表

list-style

list-style-type:列表项标志的类型

list-style-image

list-style-position

6 表格

border-collapse:表格边框折叠为单一边框or否

caption-side:表格标题的放置方式

empty-cells:隐藏表格空单元格

border-spacing:单元格边框的距离

table-layout:表格行列布局,automatic/fixed/inherit

7 轮廓

outline:位于边框边缘的外围

outline-color

outline-style

outline-width

猜你喜欢

转载自blog.csdn.net/Jiang00007/article/details/81545403