> 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). Agents can also search and read this documentation through its [MCP server](https://docs.scaleflex.com/~gitbook/mcp).

# 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. The **Section layout** dialog 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                                                                                    | Options                                                                                               |
| ----------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| **Max section width**   | How wide the content is allowed to get.                                                         | **Small (768px)**, **Medium (1024px)**, **Large (1280px)**, **Extra large (1536px)**, **Full screen** |
| **Section edges**       | Whether the section runs to the edge of the page or stops inside it. Multi-column layouts only. | **Inset**, **Edge to edge**                                                                           |
| **Bottom edge**         | A divider under the section, separating it from the next.                                       | **None**, **Line**, **Shadow**                                                                        |
| **Text alignment**      | How the section's text lines up.                                                                | Left or center                                                                                        |
| **Display decorations** | Shows or hides the variant's decorative flourishes.                                             | On or off                                                                                             |
| **Image position**      | Which side the image sits on, in sections that pair text with one.                              | **Left**, **Right**                                                                                   |

A gallery section offers only the three widest widths — **Large (1280px)** and up.

### Spacing

**Top padding** and **Bottom padding** set the space above and below the section — **None**, **Extra small**, **Small**, **Medium**, **Large** or **Extra large**. **Vertical spacing** sets the space between its own parts, from **Extra small** to **Extra large**.

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 **Section background** dialog opens on four tabs:

| Tab          | The section's background is                                                                                      |
| ------------ | ---------------------------------------------------------------------------------------------------------------- |
| **None**     | Whatever the theme gives it — *No background. The section uses the default theme background color.* The default. |
| **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. To go back to the theme's background, choose **None**.

### 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.

**Set focus point** lets you mark the part of the picture that must stay in view: as the section is cropped to fit different screen widths, the image is kept centred on that point. **Remove focus point** goes back to centring the image.

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 — **None**, **Color**, **Gradient** and **Image** — plus **Inherit**, and its **Color** tab has **Reset to default** to put the block's colour back.

**Inherit** is the one worth knowing: the block takes whatever the section behind it has — *Inherits the background from the parent section.* — 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.
