An open API service indexing awesome lists of open source software.

https://github.com/foyez/grid


https://github.com/foyez/grid

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# Grid Layout

`Grid is a two-dimensional grid-based layout system`

## Grid Terminology

![Grid Terminology](./assets/grid-terminology.jpg)

### Grid Container

- The element on which `display: grid` or `display: inline-grid` is applied
- It’s the direct parent of all the grid items

```html


Item 1

Item 2


```

```css
.container {
display: grid; /* display: inline-grid */
}
```

### Grid Item

- The children (i.e. direct descendants) of the grid container

```html


Item 1


Sub item



Item 2


```

Here the item elements are grid items, but sub-item isn’t.

![Grid Terminology](./assets/grid-terminology-1.jpg)

### Grid Line

- The dividing lines that make up the structure of the grid.
- They can be either vertical (“column grid lines”) or horizontal (“row grid lines”)

### Grid Cell

- The space between two adjacent row and two adjacent column grid lines.
- It’s a single “unit” of the grid.

### Grid Track

- the columns or rows of the grid.

### Grid Area

- A grid area may be composed of any number of grid cells.

## Grid Properties

![Grid Properties](./assets/grid-properties.jpg)

### CONTAINER

#### `display`

- Defines the element as a grid container

```css
/* grid – generates a block-level grid */
/* inline-grid – generates an inline-level grid */

.container {
display: grid | inline-grid;
}
```

#### grid-templates: grid-templates-rows, grid-template-columns, grid-templates-areas