Update and rename remove-inline-block-container-white-space.md to tile-layout-using-inline-block.md

This commit is contained in:
Angelos Chalaris
2019-10-02 09:51:59 +03:00
committed by GitHub
parent 184592b01d
commit ac36405496

View File

@ -1,9 +1,9 @@
--- ---
title: Remove inline-block container whitespace title: 3-tile layout
tags: layout,beginner tags: layout,beginner
--- ---
Creates a bouncing loader animation. Align items horizontally using `display: inline-block` to create a 3-tile layout.
```html ```html
<div class="tiles"> <div class="tiles">
@ -40,11 +40,11 @@ Creates a bouncing loader animation.
#### Explanation #### Explanation
1. `tiles` is the container of the tile component - Use `display: inline-block` to create a tiled layout, without using `float`, `flex` or `grid`.
2. `tile` is the item that we need to display inline - `.tiles` is the container component, `.tile` is an item that needs to be displayed inline.
3. `width: calc((900px / 3) - 10px)` divides the width of the tile evenly - Use `width: calc((900px / 3))` to divide the width of the container evenly into 3 columns.
4. Set `font-size: 0;` on `.tiles` to avoid whitespace - Set `font-size: 0;` on `.tiles` to avoid whitespace.
5. Set `font-size: 20px` to `h2` in order to display the text - Set `font-size: 20px` to `h2` in order to display the text.
#### Browser support #### Browser support