Client CraftClient Craft HubStart free

Style blocks: spacing, borders, backgrounds and breakpoints

On this page
Updated 24 Nov 20263 min read

Use the Style tab to set spacing, size, background, typography, border and layout for a block, with different values for tablet and mobile when you need them.

Plan: Free Visual Builder package

The Style tab changes how one block looks without touching its content. Values cascade from desktop down: set something once for every screen, then override it only where a smaller screen needs it. Colours, type and spacing values come from the site's design library.

Before you start #

  • Your developer has opted the site in to Visual Builder styles. On a block that isn't opted in, the Style options are shown greyed out with this explanation on hover: "This block doesn't use the Visual Builder style settings, so spacing, styles, animations and visibility can't be set here." See Opt a site into Visual Builder styles in code.

Step by step #

  1. 1
    Select the block and open StyleSelect a block on the canvas, then open Style in the right panel.
  2. 2
    Set spacingUnder Spacing, set Padding and margin. By default you edit one horizontal and one vertical value; select Edit each side for four separate values. You can also drag the padding handles on the canvas. Hovering a field highlights its side on the page.
  3. 3
    Set the other groups
    • Size: width, maximum width, content maximum width and minimum height.
    • Background: background colour and text colour.
    • Typography: font family, size, weight, line height and alignment.
    • Border: border colour, width and corner radius.
    • Shadow & effects: shadow and opacity.
    • Position: position, offsets and stacking order.
    • Layout: display, direction, alignment, justification and gaps.

    Choose a unit before you type a number if the default unit isn't the one you want.

  4. 4
    Change a value for a smaller screenSwitch the device in the toolbar to Tablet or Phone. The Style tab now shows that size (for example "Tablet · up to 991 px") and how many overrides it has. Values you don't change are inherited from the wider size, which is named beside the field. A dot next to a value means it is set for this size; click it to go back to the wider size's value. Reset all clears every override for this size.
  5. 5
    Open more optionsMore style options opens the full style editor. There you can style other states of the block through Appearance: Default, Hover, Keyboard focus, Pressed, Selected, Disabled and Open (the states offered depend on the block). The full editor also has outline, motion and animation settings.

Screen sizes #

SizeApplies up to
Desktopevery width (the starting point)
Tablet991 px
Mobile landscape767 px
Mobile portrait479 px
NoteColours are picked from the design library, not typed as fixed values, so a brand change in the library updates every block that uses it. See The design library.
TipUse Keyboard focus to give links and buttons a clear focus outline. Keyboard users need it.

What happens next #

Preview on desktop, tablet and phone, then publish.

Was this article helpful?