update css md

This commit is contained in:
jessica 2019-10-22 22:24:51 +07:00
parent 4da6b9adbe
commit 31fa66ce5d
1 changed files with 42 additions and 22 deletions

24
css.md
View File

@ -13,6 +13,7 @@ keywords:
--- ---
## Basics ## Basics
{: .-three-column} {: .-three-column}
### Selectors ### Selectors
@ -22,10 +23,12 @@ keywords:
font-weight: bold; font-weight: bold;
} }
``` ```
{: .-setup} {: .-setup}
| Selector | Description | | Selector | Description |
| ----------------- | ----------- | | ----------------- | ------------ |
| `*` | All Elements |
| `div` | Element | | `div` | Element |
| `.class` | Class | | `.class` | Class |
| `#id` | ID | | `#id` | ID |
@ -40,6 +43,7 @@ keywords:
| `.parent > .child` | Direct descendant | | `.parent > .child` | Direct descendant |
| `.child + .sibling` | Adjacent sibling | | `.child + .sibling` | Adjacent sibling |
| `.child ~ .sibling` | Far sibling | | `.child ~ .sibling` | Far sibling |
| `.class.class` | Have both class |
### Attribute selectors ### Attribute selectors
@ -55,7 +59,7 @@ keywords:
### Pseudo-classes ### Pseudo-classes
| Selector | Description | | Selector | Description |
| -------------------- | ------------------------ | | -------------------- | ------------------------------------------ |
| `:target` | eg, `h2#foo:target` | | `:target` | eg, `h2#foo:target` |
| --- | --- | | --- | --- |
| `:disabled` | | | `:disabled` | |
@ -69,6 +73,11 @@ keywords:
| `:nth-last-child(2)` | | | `:nth-last-child(2)` | |
| `:nth-of-type(2)` | | | `:nth-of-type(2)` | |
| --- | --- | | --- | --- |
| `:checked` | Selects every checked element |
| `:disabled` | Selects every disabled element |
| `:default` | Selects the default element |
| --- | --- |
| `:empty` | Selects every element that has no children |
### Pseudo-class variations ### Pseudo-class variations
@ -83,9 +92,11 @@ keywords:
| `:last-child` | | `:last-child` |
| `:nth-child(2)` | | `:nth-child(2)` |
| `:only-child` | | `:only-child` |
{: .-left-align} {: .-left-align}
## Fonts ## Fonts
{: .-left-reference} {: .-left-reference}
### Properties ### Properties
@ -103,15 +114,18 @@ keywords:
| --- | --- | | --- | --- |
| `text-align:` | `left` `right` `center` `justify` | | `text-align:` | `left` `right` `center` `justify` |
| `text-transform:` | `capitalize` `uppercase` `lowercase` | | `text-transform:` | `capitalize` `uppercase` `lowercase` |
{: .-key-values} {: .-key-values}
### Shorthand ### Shorthand
{: .-prime} {: .-prime}
| | style | weight | size (required) | | line-height | family | | | style | weight | size (required) | | line-height | family |
| ------- | -------- | ------ | --------------- | --- | ----------- | ----------------- | | ------- | -------- | ------ | --------------- | --- | ----------- | ----------------- |
| `font:` | `italic` | `400` | `14px` | `/` | `1.5` | `sans-serif` | | `font:` | `italic` | `400` | `14px` | `/` | `1.5` | `sans-serif` |
| | style | weight | size (required) | | line-height | family (required) | | | style | weight | size (required) | | line-height | family (required) |
{: .-css-breakdown} {: .-css-breakdown}
### Example ### Example
@ -133,6 +147,7 @@ text-transform: lowercase; /* hello */
``` ```
## Background ## Background
{: .-left-reference} {: .-left-reference}
### Properties ### Properties
@ -148,6 +163,7 @@ text-transform: lowercase; /* hello */
| `background-clip:` | `border-box` `padding-box` `content-box` | | `background-clip:` | `border-box` `padding-box` `content-box` |
| `background-repeat:` | `no-repeat` `repeat-x` `repeat-y` | | `background-repeat:` | `no-repeat` `repeat-x` `repeat-y` |
| `background-attachment:` | `scroll` `fixed` `local` | | `background-attachment:` | `scroll` `fixed` `local` |
{: .-key-values} {: .-key-values}
### Shorthand ### Shorthand
@ -157,6 +173,7 @@ text-transform: lowercase; /* hello */
| `background:` | `#ff0` | `url(bg.jpg)` | `left` | `top` | `/` | `100px` `auto` | `no-repeat` | `fixed;` | | `background:` | `#ff0` | `url(bg.jpg)` | `left` | `top` | `/` | `100px` `auto` | `no-repeat` | `fixed;` |
| `background:` | `#abc` | `url(bg.png)` | `center` | `center` | `/` | `cover` | `repeat-x` | `local;` | | `background:` | `#abc` | `url(bg.png)` | `center` | `center` | `/` | `cover` | `repeat-x` | `local;` |
| | color | image | positionX | positionY | | size | repeat | attachment | | | color | image | positionX | positionY | | size | repeat | attachment |
{: .-css-breakdown} {: .-css-breakdown}
### Multiple backgrounds ### Multiple backgrounds
@ -167,6 +184,7 @@ background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
``` ```
## Animation ## Animation
{: .-left-reference} {: .-left-reference}
### Properties ### Properties
@ -182,6 +200,7 @@ background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
| `animation-direction:` | `normal` `reverse` `alternate` `alternate-reverse` | | `animation-direction:` | `normal` `reverse` `alternate` `alternate-reverse` |
| `animation-fill-mode:` | `none` `forwards` `backwards` `both` `initial` `inherit` | | `animation-fill-mode:` | `none` `forwards` `backwards` `both` `initial` `inherit` |
| `animation-play-state:` | `normal` `reverse` `alternate` `alternate-reverse` | | `animation-play-state:` | `normal` `reverse` `alternate` `alternate-reverse` |
{: .-key-values} {: .-key-values}
### Shorthand ### Shorthand
@ -190,6 +209,7 @@ background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
| ------------ | -------- | -------- | --------------- | ------- | ---------- | ------------------- | --------- | ---------- | | ------------ | -------- | -------- | --------------- | ------- | ---------- | ------------------- | --------- | ---------- |
| `animation:` | `bounce` | `300ms` | `linear` | `100ms` | `infinite` | `alternate-reverse` | `both` | `reverse` | | `animation:` | `bounce` | `300ms` | `linear` | `100ms` | `infinite` | `alternate-reverse` | `both` | `reverse` |
| | name | duration | timing-function | delay | count | direction | fill-mode | play-state | | | name | duration | timing-function | delay | count | direction | fill-mode | play-state |
{: .-css-breakdown} {: .-css-breakdown}
### Example ### Example