| 选择器 | 样式语法 |
|---|---|
类选择器 | |
标签选择器 | |
id 选择器 |
| 选择器 | 作用 | 样式语法 |
|---|---|---|
| 后代选择器 | ||
| 子代选择器 | ||
| 并集选择器 | ||
| 链接伪类选择器 | ||
| :focus 选择器 |
| property | 说明 |
|---|---|
| font-family | 设置字体(宋体 SimSun,黑体 SimHei,微软雅黑 Microsoft YaHei) |
| font-size | 字体大小(单位 px像素) |
| font-style | 设置字体样式 (默认值,浏览器标准显示 normal,斜体 italic,倾斜样式 oblique ) |
| font-weight | 指定文字粗细(默认值 normal 等价于400,粗体 bold 等价于 700,更粗 bolder) |
简写:font: font-style font-weight font-size/line-height font-family;
| property | 说明 |
|---|---|
| text-align | 对齐方式(左 left,中 center,右 right) |
| text-decoration | 文本装饰(默认浏览器标准显示 none,下划线 underline,中划线 line-through ,上划线 overline) |
| text-indent | 文本缩进(缩进两个字 2em)<1 em = 16px> |
| text-height | 行间距 |
常用:取消超链接下划线 a {text-decoration: none}