7 - "margin, padding, border"
8 - "div, .class, #id, [attr]"
10 - "display: block, inline, flex"
27 | Selector | Description |
28 | ----------------- | ----------- |
32 | `[disabled]` | Attribute |
33 | `[role="dialog"]` | Attribute |
37 | Selector | Description |
38 | ------------------- | ----------------- |
39 | `.parent .child` | Descendant |
40 | `.parent > .child` | Direct descendant |
41 | `.child + .sibling` | Adjacent sibling |
42 | `.child ~ .sibling` | Far sibling |
44 ### Attribute selectors
46 | Selector | Description |
47 | ------------------ | ----------------------------------- |
48 | `[role="dialog"]` | `=` Exact |
49 | `[class~="box"]` | `~=` Has word |
50 | `[class|="box"]` | `|=` Exact or prefix (eg, `value-`) |
51 | `[href$=".doc"]` | `$=` Ends in |
52 | `[href^="/index"]` | `^=` Begins with |
53 | `[class*="-is-"]` | `*=` Contains |
57 | Selector | Description |
58 | -------------------- | ------------------------ |
59 | `:target` | eg, `h2#foo:target` |
65 | `:nth-child(3)` | 3rd child |
66 | `:nth-child(3n+2)` | 2nd child in groups of 3 |
67 | `:nth-child(-n+4)` | |
69 | `:nth-last-child(2)` | |
70 | `:nth-of-type(2)` | |
73 ### Pseudo-class variations
93 | Property | Description |
94 | ------------------ | ------------------------------------ |
95 | `font-family:` | `<font>, <fontN>` |
96 | `font-size:` | `<size>` |
97 | `letter-spacing:` | `<size>` |
98 | `line-height:` | `<number>` |
100 | `font-weight:` | `bold` `normal` |
101 | `font-style:` | `italic` `normal` |
102 | `text-decoration:` | `underline` `none` |
104 | `text-align:` | `left` `right` `center` `justify` |
105 | `text-transform:` | `capitalize` `uppercase` `lowercase` |
111 | | style | weight | size (required) | | line-height | family |
112 | ------- | -------- | ------ | --------------- | --- | ----------- | ----------------- |
113 | `font:` | `italic` | `400` | `14px` | `/` | `1.5` | `sans-serif` |
114 | | style | weight | size (required) | | line-height | family (required) |
123 letter-spacing: 0.02em;
130 text-transform: capitalize; /* Hello */
131 text-transform: uppercase; /* HELLO */
132 text-transform: lowercase; /* hello */
140 | Property | Description |
141 | ------------------------ | ---------------------------------------- |
142 | `background:` | _(Shorthand)_ |
144 | `background-color:` | `<color>` |
145 | `background-image:` | `url(...)` |
146 | `background-position:` | `left/center/right` `top/center/bottom` |
147 | `background-size:` | `cover` `X Y` |
148 | `background-clip:` | `border-box` `padding-box` `content-box` |
149 | `background-repeat:` | `no-repeat` `repeat-x` `repeat-y` |
150 | `background-attachment:` | `scroll` `fixed` `local` |
155 | | color | image | positionX | positionY | | size | repeat | attachment |
156 | ------------- | ------ | ------------- | --------- | --------- | --- | -------------- | ----------- | ---------- |
157 | `background:` | `#ff0` | `url(bg.jpg)` | `left` | `top` | `/` | `100px` `auto` | `no-repeat` | `fixed;` |
158 | `background:` | `#abc` | `url(bg.png)` | `center` | `center` | `/` | `cover` | `repeat-x` | `local;` |
159 | | color | image | positionX | positionY | | size | repeat | attachment |
162 ### Multiple backgrounds
165 background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
166 url('background.jpg') center center / cover, #333;
175 | ---------------------------- | -------------------------------------------------------- |
176 | `animation:` | _(shorthand)_ |
177 | `animation-name:` | `<name>` |
178 | `animation-duration:` | `<time>ms` |
179 | `animation-timing-function:` | `ease` `linear` `ease-in` `ease-out` `ease-in-out` |
180 | `animation-delay:` | `<time>ms` |
181 | `animation-iteration-count:` | `infinite` `<number>` |
182 | `animation-direction:` | `normal` `reverse` `alternate` `alternate-reverse` |
183 | `animation-fill-mode:` | `none` `forwards` `backwards` `both` `initial` `inherit` |
184 | `animation-play-state:` | `normal` `reverse` `alternate` `alternate-reverse` |
189 | | name | duration | timing-function | delay | count | direction | fill-mode | play-state |
190 | ------------ | -------- | -------- | --------------- | ------- | ---------- | ------------------- | --------- | ---------- |
191 | `animation:` | `bounce` | `300ms` | `linear` | `100ms` | `infinite` | `alternate-reverse` | `both` | `reverse` |
192 | | name | duration | timing-function | delay | count | direction | fill-mode | play-state |
198 animation: bounce 300ms linear 0s infinite normal;
199 animation: bounce 300ms linear infinite;
200 animation: bounce 300ms linear infinite alternate-reverse;
201 animation: bounce 300ms linear 2s infinite alternate-reverse forwards normal;
207 .one('webkitAnimationEnd oanimationend msAnimationEnd animationend')