-
Notifications
You must be signed in to change notification settings - Fork 9
/
selectors.html
176 lines (172 loc) · 4.81 KB
/
selectors.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>CSS Selectors</title>
<style>
dl {
display: flex;
flex-flow: wrap row;
line-height: 2;
}
body {
columns: 2 22.5em;
column-gap: 2em;
}
code {
}
dt, dd, dl {margin: 0; padding: 0;}
dt {
display: inline-block;
clear: both;
width: 50%;
font-family: georgia, serif;
break-inside: avoid;
}
dt.break {clear: left;}
h2 {font-family: helvetica, sans-serif; column-span: all}
dd {
margin: 0; padding: 0;
width: 50%;
clear: none;
display: inline-block;
background-color: #dedede;
margin-bottom: 0.2em;
padding-left: 1em;
box-sizing: border-box;
}
@media print {
dl {line-height: 1.2;}
body {
columns: 2;
column-gap: 0.5em;
}
span {display: none;}
}
</style>
</head>
<body>
<h2>CSS selectors level 4</h2>
<dl>
<dt>Case-insensitive attribute selector</dt>
<dd><code>[attribute='value' i]</code></dd>
<dt>Blank <span>pseudo-class</span></dt>
<dd><code>:blank</code></dd>
<dt>Structural <span>pseudo-class</span></dt>
<dd><code>:nth-match()</code></dd>
<dt>Dir <span>pseudo-class</span></dt>
<dd><code>:dir(ltr)</code></dd>
<dt>Drop <span>pseudo-class</span>*</dt>
<dd><code>:drop</code></dd>
<dt>Hyperlink <span>pseudo-class</span></dt>
<dd><code>:any-link</code></dd>
<dt>Lang <span>pseudo-class</span></dt>
<dd><code>:lang(*-en)</code></dd>
<dt>Local link <span>pseudo-class</span></dt>
<dd><code>:local-link</code></dd>
<dt>Matches-any <span>pseudo-class</span></dt>
<dd><code>:matches(s1, s2)</code></dd>
<dt>Mutability* <span>pseudo-class</span></dt>
<dd><code>:read-only <br/> :read-write</code></dd>
<dt>Negation <span>pseudo-class</span></dt>
<dd><code>:not(s1, s2)</code></dd>
<dt>Optionality <span>pseudo-class</span></dt>
<dd><code>:required<br/> :optional</code></dd>
<dt>Placeholder <span>pseudo-class</span></dt>
<dd><code>:placeholder-shown</code></dd>
<dt>Indeterminate-value</dt>
<dd><code>:indeterminate</code></dd>
<dt>Validity <span>pseudo-classes</span></dt>
<dd><code>:valid<br/> :invalid</code></dd>
<dt>Relational <span>pseudo-class</span></dt>
<dd><code>:has()</code></dd>
<dt>Scope <span>pseudo-class</span></dt>
<dd><code>:scope</code></dd>
<dt>Range <span>pseudo-classes</span></dt>
<dd><code>:in-range<br/> :out-of-range</code></dd>
<dt>Grid <span>pseudo-classes</span></dt>
<dd><code>:column(selector)<br/>
:nth-column(n)<br/>
:nth-last-column(n)</code></dd>
<dt>Time <span>pseudo-class</span></dt>
<dd><code>:current</code></dd>
<dt>Default option <span>pseudo-class</span></dt>
<dd><code>:default</code></dd>
<dt>Column combinator*</dt>
<dd><code>E || F</code></dd>
<dt>Descendant combinator</dt>
<dd><code>E >> F</code></dd>
<dt><strike title="deprecated">Reference combinator</dt>
<dd><code>E /foo/ F</code></strike>
</dd>
<dt><strike title="deprecated">Parent combinator</dt>
<dd><code>E! > F</code></strike></dt>
</dl>
<h2>CSS selectors level 3</h2>
<dl>
<dt>Attribute selectors</dt>
<dd><code>[attribute^='val']<br/>
[attribute$='lue']<br/>
[attribute*='alu']</code></dd>
<dt>Target <span>pseudo-class</span></dt>
<dd><code>:target</code></dd>
<dt>Negation <span>pseudo-class</span></dt>
<dd><code>:not(s)</code></dd>
<dt>General sibling combinator</dt>
<dd><code>E ~ F</code></dd>
<dt>Enabled and Disabled <span>pseudo-class</span></dt>
<dd><code>:enabled<br/> :disabled</code></dd>
<dt>Selected-option</dt>
<dd><code>:checked</code></dd>
<dt> </dt><dd style="background:none"> </dd>
<dt> </dt><dd style="background:none"> </dd>
<dt style="break-before: column">Structural pseudo-classes</dt>
<dd><code>:root<br/>
:empty<br/>
:last-child<br/>
:only-child<br/>
:first-of-type<br/>
:last-of-type<br/>
:only-of-type<br/>
:nth-child(n)<br/>
:nth-last-child(n)<br/>
:nth-of-type(n)<br/>
:nth-last-of-type(n)</code></dt>
</dl>
<h2>CSS selectors level 2</h2>
<dl>
<dt>Universal selector</dt>
<dd><code>*</code></dd>
<dt>Lang <span>pseudo-class</span></dt>
<dd><code>:lang(en)</code></dd>
<dt>User action <span>pseudo-class</span></dt>
<dd><code>:hover<br/> :focus</code></dd>
<dt>Structural <span>pseudo-class</span></dt>
<dd><code>:first-child</code></dd>
<dt>Child combinator</dt>
<dd><code>E > F</code></dd>
<dt>Attribute Selectors</dt>
<dd><code>[attribute]<br/>
[attribute='value']<br/>
[attribute~='value']<br/>
[attribute|='en']</code></dd>
<dt>Adjacent sibling combinator</dt>
<dd><code>E + F</code></dt>
</dl>
<h2>CSS selectors level 1</h2>
<dl>
<dt>Type selector</dt>
<dd><code>E</code></dd>
<dt>Descendant selector</dt>
<dd><code>E F</code></dd>
<dt>Class selector</dt>
<dd><code>.class</code></dd>
<dt>ID selector</dt>
<dd><code>#elID</code></dd>
<dt>Link <span>pseudo-class</span></dt>
<dd><code>:link</code></dd>
<dt>User action <span>pseudo-class</span></dt>
<dd><code>:active</code></dt>
</dl>
</body>
</html>