From f3e8ebf10258811df0ef6f8a288c35e066099844 Mon Sep 17 00:00:00 2001 From: jaywcjlove Date: Sun, 30 Oct 2022 15:11:36 +0000 Subject: [PATCH] doc: update `css.md`. fb464bd4ff19835ffce123d17b86683baa1d10a4 --- docs/css.html | 52 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/docs/css.html b/docs/css.html index a38fe3cd..f202a312 100644 --- a/docs/css.html +++ b/docs/css.html @@ -305,7 +305,7 @@ -
选择器说明
a[target]带有 target 属性
a[target="_blank"]在新标签中打开
a[href^="/index"]/index 开头
[class|="chair"]chair开头
[class*="chair"]包含chair
[title~="chair"]包含单词 chair
a[href$=".doc"].doc 结尾
[type="button"]指定类型
+
选择器说明
a[target]带有 target 属性 #
a[target="_blank"]在新标签中打开 #
a[href^="/index"]/index 开头 #
[class|="chair"]chair开头 #
[class*="chair"]包含chair #
[title~="chair"]包含单词 chair #
a[href$=".doc"].doc 结尾 #
[type="button"]指定类型 #

另见: 属性选择器

用户操作伪类

@@ -388,7 +388,23 @@ -
选择器说明
p::after在 p 之后添加内容 #
p::before在 p 之前添加内容 #
p::first-letterp中的第一个字母 #
p::first-linep 中的第一行 #
::selection由用户选择 #
::placeholder占位符 属性 #
:root文档根元素 #
:target突出显示活动锚点 #
div:empty没有子元素的元素 #
p:lang(en)带有 en 语言属性的 P #
:not(span)不是跨度的元素 #
+ + + + + + + + + + + + + + + + +
选择器说明
p::after在 p 之后添加内容 #
p::before在 p 之前添加内容 #
p::first-letterp中的第一个字母 #
p::first-linep 中的第一行 #
::selection由用户选择 #
::placeholder占位符 属性 #
:root文档根元素 #
:target突出显示活动锚点 #
div:empty没有子元素的元素 #
p:lang(en)带有 en 语言属性的 P #
:not(span)不是跨度的元素 #
:hostshadowDOM 中选择自定义元素 #
::backdrop处于全屏模式的元素样式 #
::markerli 项目符号或者数字 #
::file-selector-buttontype="file" input 按钮 #

输入伪类

@@ -451,7 +467,15 @@ -
选择器说明
input:checked检查 input #
input:disabled禁用 input #
input:enabled启用的 input #
input:focusinput 有焦点 #
input:in-range范围内的值 #
input:out-of-rangeinput 值超出范围 #
input:validinput 有效值 #
input:invalidinput 无效值 #
input:optional没有必需的属性 #
input:required带有必需属性的 input #
input:read-only具有只读属性 #
input:read-write没有只读属性 #
input:indeterminate带有 indeterminate 状态 #
+ + + + + + + + +
选择器说明
input:checked检查 input #
input:disabled禁用 input #
input:enabled启用的 input #
input:default有默认值的元素 #
input:blank空的输入框 #
input:focusinput 有焦点 #
input:in-range范围内的值 #
input:out-of-rangeinput 值超出范围 #
input:validinput 有效值 #
input:invalidinput 无效值 #
input:optional没有必需的属性 #
input:required带有必需属性的 input #
input:read-only具有只读属性 #
input:read-write没有只读属性 #
input:indeterminate带有 indeterminate 状态 #

结构伪类

@@ -506,7 +530,27 @@ -
选择器说明
p:first-child第一个孩子 #
p:last-child最后一个孩子 #
p:first-of-type首先是某种类型 #
p:last-of-type某种类型的最后一个 #
p:nth-child(2)其父母的第二个孩子 #
p:nth-child(3n42)Nth-child(an + b) 公式 #
p:nth-last-child(2)后面的二孩 #
p:nth-of-type(2)其父级的第二个 p #
p:nth-last-of-type(2)...从后面 #
p:only-of-type其父级的唯一性 #
p:only-child其父母的唯一孩子 #
+ + + + + + + + + + + + + + + + + + + + +
选择器说明
p:first-child第一个孩子 #
p:last-child最后一个孩子 #
p:first-of-type首先是某种类型 #
p:last-of-type某种类型的最后一个 #
p:nth-child(2)其父母的第二个孩子 #
p:nth-child(3n42)Nth-child(an + b) 公式 #
p:nth-last-child(2)后面的二孩 #
p:nth-of-type(2)其父级的第二个 p #
p:nth-last-of-type(2)...从后面 #
p:only-of-type其父级的唯一性 #
p:only-child其父母的唯一孩子 #
:is(header, div) p可以选择的元素 #
:where(header, div) p:is 相同 #
a:has(> img)包含 img 元素的 a 元素 #
::first-letter第一行的第一个字母 #
::first-line第一行应用样式 #

CSS 字体

属性