1. HTML
2. CSS
2.1 CSS 选择器优先级
!important > 行间样式 > id 选择器 > Class 选择器 | 属性选择器 | 伪类选择器 > 标签选择器 | 伪元素选择器 > 通配符选择器
2.2 CSS 选择器权重(256进制)
| 选择器 | 权重 |
|---|---|
| !important | infinity |
| 行间样式 | 1000 |
| id 选择器 | 100 |
| Class 选择器、属性选择器、伪类选择器 | 10 |
| 标签选择器、伪元素选择器 | 1 |
| 通配符选择器 | 0 |
2.3 盒模型可视区域大小
盒模型宽 = border-left + padding-left + width + padding-right + border-right
盒模型高 = border-top + padding-top + height + padding-bottom + border-bottom
2.4 margin 塌陷
2.5 单行文本超出文本区域显示省略号 三件套
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
3. JavaScript
4. 其他
4.1 主流浏览器及其内核
| 浏览器 | 内核 |
|---|---|
| IE | Trident |
| Firefox | Gecko |
| Chrome | WebKit/Blink |
| Safari | WebKit |
| Opera | Presto/Blink |









网友评论