7 - "margin, padding, border"
8 - "div, .class, #id, [attr]"
10 - "display: block, inline, flex"
27 | Selector | Description |
28 | ----------------- | ------------ |
29 | `*` | All elements |
33 | `[disabled]` | Attribute |
34 | `[role="dialog"]` | Attribute |
38 | Selector | Description |
39 | ------------------- | ----------------- |
40 | `.parent .child` | Descendant |
41 | `.parent > .child` | Direct descendant |
42 | `.child + .sibling` | Adjacent sibling |
43 | `.child ~ .sibling` | Far sibling |
44 | `.class1.class2` | Have both classes |
46 ### Attribute selectors
48 | Selector | Description |
49 | ------------------ | ----------------------------------- |
50 | `[role="dialog"]` | `=` Exact |
51 | `[class~="box"]` | `~=` Has word |
52 | `[class|="box"]` | `|=` Exact or prefix (eg, `value-`) |
53 | `[href$=".doc"]` | `$=` Ends in |
54 | `[href^="/index"]` | `^=` Begins with |
55 | `[class*="-is-"]` | `*=` Contains |
59 | Selector | Description |
60 | -------------------- | ------------------------------------------ |
61 | `:target` | eg, `h2#foo:target` |
67 | `:nth-child(3)` | 3rd child |
68 | `:nth-child(3n+2)` | 2nd child in groups of 3 |
69 | `:nth-child(-n+4)` | |
71 | `:nth-last-child(2)` | |
72 | `:nth-of-type(2)` | |
74 | `:checked` | Checked inputs |
75 | `:disabled` | Disabled elements |
76 | `:default` | Default element in a group |
78 | `:empty` | Elements without children |
80 ### Pseudo-class variations
100 | Property | Description |
101 | ------------------ | ------------------------------------ |
102 | `font-family:` | `<font>, <fontN>` |
103 | `font-size:` | `<size>` |
104 | `letter-spacing:` | `<size>` |
105 | `line-height:` | `<number>` |
107 | `font-weight:` | `bold` `normal` |
108 | `font-style:` | `italic` `normal` |
109 | `text-decoration:` | `underline` `none` |
111 | `text-align:` | `left` `right` `center` `justify` |
112 | `text-transform:` | `capitalize` `uppercase` `lowercase` |
118 | | style | weight | size (required) | | line-height | family |
119 | ------- | -------- | ------ | --------------- | --- | ----------- | ----------------- |
120 | `font:` | `italic` | `400` | `14px` | `/` | `1.5` | `sans-serif` |
121 | | style | weight | size (required) | | line-height | family (required) |
130 letter-spacing: 0.02em;
137 text-transform: capitalize; /* Hello */
138 text-transform: uppercase; /* HELLO */
139 text-transform: lowercase; /* hello */
147 | Property | Description |
148 | ------------------------ | ---------------------------------------- |
149 | `background:` | _(Shorthand)_ |
151 | `background-color:` | `<color>` |
152 | `background-image:` | `url(...)` |
153 | `background-position:` | `left/center/right` `top/center/bottom` |
154 | `background-size:` | `cover` `X Y` |
155 | `background-clip:` | `border-box` `padding-box` `content-box` |
156 | `background-repeat:` | `no-repeat` `repeat-x` `repeat-y` |
157 | `background-attachment:` | `scroll` `fixed` `local` |
162 | | color | image | positionX | positionY | | size | repeat | attachment |
163 | ------------- | ------ | ------------- | --------- | --------- | --- | -------------- | ----------- | ---------- |
164 | `background:` | `#ff0` | `url(bg.jpg)` | `left` | `top` | `/` | `100px` `auto` | `no-repeat` | `fixed;` |
165 | `background:` | `#abc` | `url(bg.png)` | `center` | `center` | `/` | `cover` | `repeat-x` | `local;` |
166 | | color | image | positionX | positionY | | size | repeat | attachment |
169 ### Multiple backgrounds
172 background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
173 url('background.jpg') center center / cover, #333;
182 | ---------------------------- | -------------------------------------------------------- |
183 | `animation:` | _(shorthand)_ |
184 | `animation-name:` | `<name>` |
185 | `animation-duration:` | `<time>ms` |
186 | `animation-timing-function:` | `ease` `linear` `ease-in` `ease-out` `ease-in-out` |
187 | `animation-delay:` | `<time>ms` |
188 | `animation-iteration-count:` | `infinite` `<number>` |
189 | `animation-direction:` | `normal` `reverse` `alternate` `alternate-reverse` |
190 | `animation-fill-mode:` | `none` `forwards` `backwards` `both` `initial` `inherit` |
191 | `animation-play-state:` | `normal` `reverse` `alternate` `alternate-reverse` |
196 | | name | duration | timing-function | delay | count | direction | fill-mode | play-state |
197 | ------------ | -------- | -------- | --------------- | ------- | ---------- | ------------------- | --------- | ---------- |
198 | `animation:` | `bounce` | `300ms` | `linear` | `100ms` | `infinite` | `alternate-reverse` | `both` | `reverse` |
199 | | name | duration | timing-function | delay | count | direction | fill-mode | play-state |
205 animation: bounce 300ms linear 0s infinite normal;
206 animation: bounce 300ms linear infinite;
207 animation: bounce 300ms linear infinite alternate-reverse;
208 animation: bounce 300ms linear 2s infinite alternate-reverse forwards normal;
214 .one('webkitAnimationEnd oanimationend msAnimationEnd animationend')