Revamp snippet descriptions
This commit is contained in:
@ -3,15 +3,12 @@ title: 3-tile layout
|
||||
tags: layout,beginner
|
||||
---
|
||||
|
||||
Align items horizontally using `display: inline-block` to create a 3-tile layout.
|
||||
Aligns items horizontally using `display: inline-block` to create a 3-tile layout.
|
||||
|
||||
- Use `display: inline-block` to create a tiled layout, without using `float`, `flex` or `grid`.
|
||||
- `.tiles` is the container component, `.tile` is an item that needs to be displayed inline.
|
||||
- Use `width: calc((900px / 3))` to divide the width of the container evenly into 3 columns.
|
||||
- Set `font-size: 0;` on `.tiles` to avoid whitespace.
|
||||
- Set `font-size: 20px` to `h2` in order to display the text.
|
||||
- Note: If you use relative units (e.g. `em`), using `font-size: 0;` to fight whitespace between blocks might cause side effects.
|
||||
|
||||
- Use `width` in combination with `calc` to divide the width of the container evenly into 3 columns.
|
||||
- Set `font-size` for `.tiles` to `0` to avoid whitespace and to `20px` for `<h2>` elements to display the text.
|
||||
- **Note:** If you use relative units (e.g. `em`), using `font-size: 0;` to fight whitespace between blocks might cause side effects.
|
||||
|
||||
```html
|
||||
<div class="tiles">
|
||||
|
||||
Reference in New Issue
Block a user