doc: add conflicting rules section

This commit is contained in:
Leon Xu committed 2021-08-08 14:02:26 -07:00
1 parent a057177285
commit 1bb323a85a
1 file changed
+21 -1
+21 -1
View File
@@ -110,4 +110,24 @@ a { color: red; } /* 不特定 */
a.some-link { color: white; } /* 有些特定的 */
a#my-link { color: blue; } /* 非常具体的 */
```
即使稍后出现不太具体的规则,也是如此。
即使稍后出现不太具体的规则,也是如此。
## 冲突规则
这是CSS中“级联”的一个重要部分:就像水从边缘滑落一样,最终都在底部形成一个水池,但有些水滴会在其他水滴之前到达那里。
假设我们有一下的规则:
```html
<p id="text">
Hello World!
</p>
```
```css
p {
color: blue;
}
p {
text-decoration: underline;
}
```
那现在,我们的Hello World会是怎么样的呢?自己可以尝试一下