7 - "margin, padding, border"
8 - "div, .class, #id, [attr]"
10 - "display: block, inline, flex"
29 | Selector | Description |
30 | ----------------- | ------------ |
31 | `*` | All elements |
35 | `[disabled]` | Attribute |
36 | `[role="dialog"]` | Attribute |
40 | Selector | Description |
41 | ------------------- | ----------------- |
42 | `.parent .child` | Descendant |
43 | `.parent > .child` | Direct descendant |
44 | `.child + .sibling` | Adjacent sibling |
45 | `.child ~ .sibling` | Far sibling |
46 | `.class1.class2` | Have both classes |
48 ### Attribute selectors
50 | Selector | Description |
51 | ------------------ | ----------------------------------- |
52 | `[role="dialog"]` | `=` Exact |
53 | `[class~="box"]` | `~=` Has word |
54 | `[class|="box"]` | `|=` Exact or prefix (eg, `value-`) |
55 | `[href$=".doc"]` | `$=` Ends in |
56 | `[href^="/index"]` | `^=` Begins with |
57 | `[class*="-is-"]` | `*=` Contains |
61 | Selector | Description |
62 | -------------------- | ------------------------------------------ |
63 | `:target` | eg, `h2#foo:target` |
69 | `:nth-child(3)` | 3rd child |
70 | `:nth-child(3n+2)` | 2nd child in groups of 3 |
71 | `:nth-child(-n+4)` | |
73 | `:nth-last-child(2)` | |
74 | `:nth-of-type(2)` | |
76 | `:checked` | Checked inputs |
77 | `:disabled` | Disabled elements |
78 | `:default` | Default element in a group |
80 | `:empty` | Elements without children |
82 ### Pseudo-class variations
104 | Property | Description |
105 | ------------------ | ------------------------------------ |
106 | `font-family:` | `<font>, <fontN>` |
107 | `font-size:` | `<size>` |
108 | `letter-spacing:` | `<size>` |
109 | `line-height:` | `<number>` |
111 | `font-weight:` | `bold` `normal` |
112 | `font-style:` | `italic` `normal` |
113 | `text-decoration:` | `underline` `none` |
115 | `text-align:` | `left` `right` `center` `justify` |
116 | `text-transform:` | `capitalize` `uppercase` `lowercase` |
124 | | style | weight | size (required) | | line-height | family |
125 | ------- | -------- | ------ | --------------- | --- | ----------- | ----------------- |
126 | `font:` | `italic` | `400` | `14px` | `/` | `1.5` | `sans-serif` |
127 | | style | weight | size (required) | | line-height | family (required) |
137 letter-spacing: 0.02em;
144 text-transform: capitalize; /* Hello */
145 text-transform: uppercase; /* HELLO */
146 text-transform: lowercase; /* hello */
155 | Property | Description |
156 | ------------------------ | ---------------------------------------- |
157 | `background:` | _(Shorthand)_ |
159 | `background-color:` | `<color>` |
160 | `background-image:` | `url(...)` |
161 | `background-position:` | `left/center/right` `top/center/bottom` |
162 | `background-size:` | `cover` `X Y` |
163 | `background-clip:` | `border-box` `padding-box` `content-box` |
164 | `background-repeat:` | `no-repeat` `repeat-x` `repeat-y` |
165 | `background-attachment:` | `scroll` `fixed` `local` |
171 | | color | image | positionX | positionY | | size | repeat | attachment |
172 | ------------- | ------ | ------------- | --------- | --------- | --- | -------------- | ----------- | ---------- |
173 | `background:` | `#ff0` | `url(bg.jpg)` | `left` | `top` | `/` | `100px` `auto` | `no-repeat` | `fixed;` |
174 | `background:` | `#abc` | `url(bg.png)` | `center` | `center` | `/` | `cover` | `repeat-x` | `local;` |
175 | | color | image | positionX | positionY | | size | repeat | attachment |
179 ### Multiple backgrounds
182 background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
183 url('background.jpg') center center / cover, #333;
193 | ---------------------------- | -------------------------------------------------------- |
194 | `animation:` | _(shorthand)_ |
195 | `animation-name:` | `<name>` |
196 | `animation-duration:` | `<time>ms` |
197 | `animation-timing-function:` | `ease` `linear` `ease-in` `ease-out` `ease-in-out` |
198 | `animation-delay:` | `<time>ms` |
199 | `animation-iteration-count:` | `infinite` `<number>` |
200 | `animation-direction:` | `normal` `reverse` `alternate` `alternate-reverse` |
201 | `animation-fill-mode:` | `none` `forwards` `backwards` `both` `initial` `inherit` |
202 | `animation-play-state:` | `normal` `reverse` `alternate` `alternate-reverse` |
208 | | name | duration | timing-function | delay | count | direction | fill-mode | play-state |
209 | ------------ | -------- | -------- | --------------- | ------- | ---------- | ------------------- | --------- | ---------- |
210 | `animation:` | `bounce` | `300ms` | `linear` | `100ms` | `infinite` | `alternate-reverse` | `both` | `reverse` |
211 | | name | duration | timing-function | delay | count | direction | fill-mode | play-state |
218 animation: bounce 300ms linear 0s infinite normal;
219 animation: bounce 300ms linear infinite;
220 animation: bounce 300ms linear infinite alternate-reverse;
221 animation: bounce 300ms linear 2s infinite alternate-reverse forwards normal;
227 .one('webkitAnimationEnd oanimationend msAnimationEnd animationend')