From 1bb323a85a210702b62cc2d73c6feb84d99ea557 Mon Sep 17 00:00:00 2001 From: Leon Xu <6479451-leonxu260@users.noreply.gitlab.com> Date: Sun, 8 Aug 2021 14:02:26 -0700 Subject: [PATCH] doc: add conflicting rules section --- source/_posts/CSS.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/source/_posts/CSS.md b/source/_posts/CSS.md index 269d65d..dca7262 100644 --- a/source/_posts/CSS.md +++ b/source/_posts/CSS.md @@ -110,4 +110,24 @@ a { color: red; } /* 不特定 */ a.some-link { color: white; } /* 有些特定的 */ a#my-link { color: blue; } /* 非常具体的 */ ``` -即使稍后出现不太具体的规则,也是如此。 \ No newline at end of file +即使稍后出现不太具体的规则,也是如此。 + +## 冲突规则 +这是CSS中“级联”的一个重要部分:就像水从边缘滑落一样,最终都在底部形成一个水池,但有些水滴会在其他水滴之前到达那里。 + +假设我们有一下的规则: +```html +

+ Hello World! +

+``` + +```css +p { + color: blue; +} +p { + text-decoration: underline; +} +``` +那现在,我们的Hello World会是怎么样的呢?自己可以尝试一下 \ No newline at end of file