From 3fc14a905ae2867697fe17c399370df1918c4f69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=A6=E8=AF=97=E8=AF=97?= <2146499714@qq.com> Date: Mon, 14 Oct 2024 17:11:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=98=BB=E5=98=BB=E5=98=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...44\272\214\345\215\201\344\270\21101.html" | 0 ...44\272\214\345\215\201\344\270\21102.html" | 0 ...44\272\214\345\215\201\344\270\21103.html" | 2 +- ...44\272\214\345\215\201\344\270\21104.html" | 24 ++++ ...44\272\214\345\215\201\344\270\21105.html" | 39 +++++++ ...44\272\214\345\215\201\344\270\21106.html" | 31 +++++ ...73\351\200\211\346\213\251\345\231\250.md" | 110 ++++++++++++++++++ 7 files changed, 205 insertions(+), 1 deletion(-) rename "\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-12/\344\272\214\345\215\201\344\270\21101.html" => "\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21101.html" (100%) rename "\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-12/\344\272\214\345\215\201\344\270\21102.html" => "\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21102.html" (100%) rename "\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-12/\344\272\214\345\215\201\344\270\21103.html" => "\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21103.html" (94%) create mode 100644 "\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21104.html" create mode 100644 "\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21105.html" create mode 100644 "\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21106.html" create mode 100644 "\351\237\246\350\257\227\350\257\227/\347\254\224\350\256\260/2024-10-14-\344\274\252\347\261\273\351\200\211\346\213\251\345\231\250.md" diff --git "a/\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-12/\344\272\214\345\215\201\344\270\21101.html" "b/\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21101.html" similarity index 100% rename from "\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-12/\344\272\214\345\215\201\344\270\21101.html" rename to "\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21101.html" diff --git "a/\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-12/\344\272\214\345\215\201\344\270\21102.html" "b/\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21102.html" similarity index 100% rename from "\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-12/\344\272\214\345\215\201\344\270\21102.html" rename to "\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21102.html" diff --git "a/\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-12/\344\272\214\345\215\201\344\270\21103.html" "b/\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21103.html" similarity index 94% rename from "\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-12/\344\272\214\345\215\201\344\270\21103.html" rename to "\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21103.html" index d36cfa2c..d10b6749 100644 --- "a/\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-12/\344\272\214\345\215\201\344\270\21103.html" +++ "b/\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21103.html" @@ -14,7 +14,7 @@ /* 当前激活的链接(class="active")的子元素 在悬停时背景色变为深灰色 */ nav ul li a.active:hover { background-color: darkgray; - /* 或者你可以使用 #a9a9a9 表示深灰色 */ + } diff --git "a/\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21104.html" "b/\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21104.html" new file mode 100644 index 00000000..d9f64257 --- /dev/null +++ "b/\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21104.html" @@ -0,0 +1,24 @@ + + + + + + Document + + + + +

Special Title

+ + + \ No newline at end of file diff --git "a/\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21105.html" "b/\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21105.html" new file mode 100644 index 00000000..2576904d --- /dev/null +++ "b/\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21105.html" @@ -0,0 +1,39 @@ + + + + + + + Document + + + + + + + + + + \ No newline at end of file diff --git "a/\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21106.html" "b/\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21106.html" new file mode 100644 index 00000000..a00f438f --- /dev/null +++ "b/\351\237\246\350\257\227\350\257\227/\344\275\234\344\270\232/2024-10-14/\344\272\214\345\215\201\344\270\21106.html" @@ -0,0 +1,31 @@ + + + + + + Document + + + + +
+
+ + + + + +
+
+ + + \ No newline at end of file diff --git "a/\351\237\246\350\257\227\350\257\227/\347\254\224\350\256\260/2024-10-14-\344\274\252\347\261\273\351\200\211\346\213\251\345\231\250.md" "b/\351\237\246\350\257\227\350\257\227/\347\254\224\350\256\260/2024-10-14-\344\274\252\347\261\273\351\200\211\346\213\251\345\231\250.md" new file mode 100644 index 00000000..5ea1520c --- /dev/null +++ "b/\351\237\246\350\257\227\350\257\227/\347\254\224\350\256\260/2024-10-14-\344\274\252\347\261\273\351\200\211\346\213\251\345\231\250.md" @@ -0,0 +1,110 @@ +# 常见的伪类选择器 +1. :hover + +用于选择鼠标悬停在其上的元素。 + +``` +a:hover { + color: red; +} +``` +2. :focus + +用于选择获得焦点的元素(通常是表单元素)。 +``` +input:focus { + border: 2px solid blue; +} +``` +3. :active + +用于选择被用户激活的元素(通常是通过鼠标点击)。 +``` +button:active { + background-color: green; +} +``` +4. :first-child + +用于选择其父元素的第一个子元素。 +``` +p:first-child { + font-weight: bold; +} +``` +5. :last-child + +用于选择其父元素的最后一个子元素。 +``` +p:last-child { + color: purple; +} +``` +6. :nth-child(n) + +用于选择其父元素的第n个子元素。n 可以是一个数字、关键词(如 odd 或 even),或者一个公式(如 2n+1)。 +``` +li:nth-child(2) { + color: orange; +} +``` +``` +li:nth-child(odd) { + background-color: lightgray; +} +``` +7. :not(selector) + +用于选择不匹配给定选择器的元素。 +``` +div:not(.special) { + border: 1px solid black; +} +``` + +# 常见的伪元素 +1. ::before + +在选定元素的内容之前插入内容。通常用于添加装饰性内容或图标。 +``` +p::before { + content: "Note: "; + color: blue; +} +``` +2. ::after + +在选定元素的内容之后插入内容。 +``` +p::after { + content: "*"; + color: red; +} +``` +3. ::first-letter + +用于选择块级元素的首字母,并对其进行样式化。 +``` +p::first-letter { + font-size: 2em; + color: gold; +} +``` +4. ::first-line + +用于选择块级元素的首行,并对其进行样式化。 +``` +p::first-line { + font-weight: bold; + color: green; +} +``` +5. ::selection + +用于选择用户高亮(选择)的文本。 +``` +::selection { + background: yellow; + color: black; +} +``` -- Gitee