Update snippets

This commit is contained in:
Angelos Chalaris
2020-04-20 13:05:10 +03:00
parent 2d1f637692
commit d35dab24c3
10 changed files with 43 additions and 89 deletions

View File

@ -33,14 +33,11 @@ Vertically and horizontally centers a child element within its parent element us
#### Explanation
1. `display: table` on '.center' allows the element to behave like a `<table>` HTML element.
2. 100% height and width on '.center' allows the element to fill the available space within its parent element.
3. `display: table-cell` on '.center > span' allows the element to behave like an <td> HTML element.
4. `text-align: center` on '.center > span' centers the child element horizontally.
5. `vertical-align: middle` on '.center > span' centers the child element vertically.
- `display: table` on '.center' allows the element to behave like a `<table>` HTML element.
- 100% height and width on '.center' allows the element to fill the available space within its parent element.
- `display: table-cell` on '.center > span' allows the element to behave like an <td> HTML element.
- `text-align: center` on '.center > span' centers the child element horizontally.
- `vertical-align: middle` on '.center > span' centers the child element vertically.
- The outer parent ('.container' in this case) must have a fixed height and width.
#### Browser support
- https://caniuse.com/#search=display%3A%20table