---
url: https://docs.artemsemkin.com/velum/html/look/spacing-and-layout.md
description: Change spacing and lay a section out on the grid.
---

# Spacing and layout

The space around and between things comes from a few sizes in `css/variables.css`, each growing with the window. Inside a section, columns are laid out with the grid classes of [Bootstrap 6](https://getbootstrap.com/), the same `container`, `row` and `col-*` classes as in any Bootstrap site.

## How to access

**HTML/css/variables.css → Spacing, min and max** for the sizes, and **any page → the classes inside a `<section>`** for the grid.

![Casa Notte's Credits: a label in a column of three twelfths beside the list in nine](https://docs.artemsemkin.com/velum/html/images/look/spacing-and-layout-1.png)

## Changing the spacing

Each size is a pair: its value in pixels at a 360-pixel-wide window and at 1920, growing in between. The comment beside each pair names what uses it:

```css
--velum-space-s-min: 10;
--velum-space-s-max: 20; /* small gaps, sticky header */
--velum-space-m-min: 20;
--velum-space-m-max: 48; /* row gutter, gap-12 */
--velum-space-l-min: 40;
--velum-space-l-max: 60; /* gap-13, p-13 */
--velum-space-xl-min: 40;
--velum-space-xl-max: 180; /* gap-14, py-14 */
--velum-gutter-x-min: 20;
--velum-gutter-x-max: 60; /* page sides */
```

Here the space at the sides of the page stops at 60 pixels instead of 120. `--velum-gutter-y` is the space above and below the header, and `--velum-layout-width` the widest a row's content gets, 1300px.

## Spacing a section with classes

The space classes of Bootstrap take a size from 0 to 14. The sizes 11 to 14 are the template's own, read from the pairs above, so they grow with the window:

| Size | Space | Example |
| --- | --- | --- |
| `11` | `--velum-space-s` | `gap-11` |
| `12` | `--velum-space-m` | `gap-12` |
| `13` | `--velum-space-l` | `gap-13`, `p-13` |
| `14` | `--velum-space-xl` | `py-14`, above and below a section |

```html
<section class="py-14">
```

## Laying out columns

A row of columns is a `row` in a `container`, and each column takes a share of twelve. A column's class applies from its width up, named by the window size as a prefix: `md:col-6` is half the row from 768 pixels wide. Below that, the columns stack.

| Prefix | From a window of |
| --- | --- |
| none | any width |
| `sm:` | 576 px |
| `md:` | 768 px |
| `lg:` | 1025 px |
| `xl:` | 1280 px |
| `2xl:` | 1536 px |

The Credits of Casa Notte sit side by side from 768 pixels. With `lg:` they stack until 1025, and the label takes four twelfths:

```html
<div class="container">
  <div class="row md:align-items-baseline">
    <div class="lg:col-4">…Credits…</div>
    <div class="lg:col-8">…the list…</div>
  </div>
</div>
```

The same prefixes work on the other classes: `lg:d-none` hides a column from 1025 pixels, `md:text-center` centres text from 768. The full list of grid classes and utilities is in [Bootstrap's documentation](https://getbootstrap.com/docs/).

::: info Why a prefix instead of col-md-6?
Bootstrap 6 writes the window size in front of the class, `md:col-6`, where older versions wrote it inside, `col-md-6`. The template ships Bootstrap 6, so copy the new form, also from snippets found elsewhere.
:::

Next: [How a page is built](../pages/how-a-page-is-built).
