> For the complete documentation index, see [llms.txt](https://docs.scaleflex.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scaleflex.com/portals/building-a-portal/sections/section-layout-and-background.md).

# Section layout and background

Set a section's width, spacing, alignment and background.

Two separate controls on a section's toolbar: **Section settings** for how the section sits on the page, and **Add background** for what is behind it.

## Section layout

Open it from the cog on the section toolbar. It has two groups, and closes with **Apply changes**.

<figure><img src="https://2536208400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqsq2dR7Fjagf5eTifWZx%2Fuploads%2FzqPscrtKtkYe1gcECRbI%2Fimage.png?alt=media&#x26;token=504d9c3e-1bf4-4f99-8ab6-ad3cdc095d6e" alt="" width="375"><figcaption><p>The section layout panel, opened from the cog on the section toolbar.</p></figcaption></figure>

### Layout

| Setting                 | What it does                                                                                    |
| ----------------------- | ----------------------------------------------------------------------------------------------- |
| **Max section width**   | How wide the content is allowed to get, from narrow up to full screen.                          |
| **Section edges**       | Whether the section runs to the edge of the page or stops inside it. Multi-column layouts only. |
| **Bottom edge**         | A divider under the section, separating it from the next.                                       |
| **Text alignment**      | Left or centred.                                                                                |
| **Display decorations** | Shows or hides the variant's decorative flourishes.                                             |
| **Image position**      | Which side the image sits on, in sections that pair text with one.                              |

### Spacing

**Top padding** and **Bottom padding** set the space above and below the section; **Vertical spacing** sets the space between its own parts.

Use padding to group things: a section with little padding above and lots below reads as belonging to what precedes it. Even padding everywhere reads as a list of unrelated blocks.

## Section background

**Add background** on the toolbar sets what sits behind the section. The dialog opens on five tabs:

| Tab          | The section's background is                                                |
| ------------ | -------------------------------------------------------------------------- |
| **None**     | Whatever the theme gives it. The default.                                  |
| **Inherit**  | Taken from the parent — *Inherits the background from the parent section.* |
| **Color**    | One flat colour.                                                           |
| **Gradient** | A gradient you build.                                                      |
| **Image**    | A picture, optionally dimmed.                                              |

<div align="left"><figure><img src="https://2536208400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqsq2dR7Fjagf5eTifWZx%2Fuploads%2FQN1cWlZ422UG2kDWRiND%2Fimage.png?alt=media&#x26;token=edbc678c-6e2f-494c-8894-c3d18d242822" alt="" width="375"><figcaption><p>The <strong>Section background</strong> dialog on <strong>None</strong> — the section keeps the theme's own background.</p></figcaption></figure> <figure><img src="https://2536208400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqsq2dR7Fjagf5eTifWZx%2Fuploads%2FNzMvLR8fjeVvRuevk5tK%2Fimage.png?alt=media&#x26;token=4f6dbc7d-5a0a-41c2-a590-8aecdfd5f223" alt="" width="375"><figcaption><p>The <strong>Color</strong> tab, with a picker, your theme colours and the presets.</p></figcaption></figure></div>

On **Color**, pick from **Theme colors** to stay on-brand, or **Preset colors** for something outside it. **Reset to default** puts it back.

### Gradient

**Gradient** opens a small editor rather than a list of ready-made ramps, so the result belongs to your Portal rather than to a template.

A new gradient starts from your Portal's own accent colour, easing into the same colour slightly softened — so it reads as your brand from the first moment, not as someone else's blue-to-pink.

<div align="left"><figure><img src="https://2536208400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqsq2dR7Fjagf5eTifWZx%2Fuploads%2F4NEwaQ4gBXZl609YHHph%2Fsection-background-gradient-hq.jpg?alt=media" alt="The Gradient tab of the Section background dialog" width="375"><figcaption><p>The <strong>Gradient</strong> tab — the stop bar on top, then the type, the angle and the selected stop's colour.</p></figcaption></figure></div>

| Control                      | What it does                                                                                                                              |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **Type**                     | **Linear**, **Radial** or **Conic**.                                                                                                      |
| **Angle**                    | Which way a linear gradient runs. **Conic** has **From angle** instead.                                                                   |
| **Shape**                    | **Circle** or **Ellipse**, for a radial gradient.                                                                                         |
| The bar                      | The gradient itself. Drag a stop to move it, or add one by selecting the bar.                                                             |
| **Color** and **Position**   | The selected stop's colour, and where along the bar it sits.                                                                              |
| **Sort stops**               | Puts the stops back in order of position after you have dragged them past each other.                                                     |
| **Sync first & last colors** | Ties the last stop to the first, for a ramp that returns to where it began. While it is on, the last stop reads *Synced with first stop*. |

**Select color from theme** switches a stop's picker between **Theme colors** and **Preset colors**.

A gradient takes **between two and ten stops**. Two is a clean ramp; past four it usually stops reading as a gradient and starts reading as a mistake.

### Image

**Add a background image** and **Select image** put a picture behind the section. **Add color overlay** lays a colour over it, and **Overlay opacity** sets how much of the image survives.

An image whose resolution is too low for the space is flagged as you choose it — *The image resolution is too low and it may look pixelized.*

{% hint style="info" %}
If text becomes hard to read over a background image, an overlay at 30–50% is usually enough. Ask whether the image is carrying meaning or just atmosphere — if it's atmosphere, darkening it costs nothing.
{% endhint %}

## Backgrounds inside a section

The blocks within a section — a card, a panel, a column — can carry a background of their own, set by **Surface** on the block rather than on the section. It offers the same choices as the section background.

**Inherit** is the one worth knowing: the block takes whatever the section behind it has, so changing the section's background carries through instead of leaving a panel stranded in the old colour. It is what you want for a card that should feel part of its section rather than sitting on top of it.
