Studio Editor: Working with an Advanced CSS Grid

7 min read
In the Studio Editor, you can use an advanced CSS grid to organize the layout of elements and sections. You can choose the number of rows and columns you want, and set their size using responsive measurements (e.g. fr, Min/max, %). 
Go to our Wix Studio Academy to check out additional Wix Studio webinars, tutorials, and courses.
In this article, learn all about working with a CSS grid:

Switching from section grid to a CSS grid

Sections in the Editor come with the option to set a section grid. This is an easy-to-use version of the advanced grid, based on the same CSS logic. Switching to an advanced CSS grid gives you more precise control of the layout per breakpoint.
Note:
Once you make the switch, it is not possible to go back to a section grid. However, if you just performed the action, you can use the Undo button  at the top right of the Editor.

To switch from section grid to a CSS grid:

  1. Select the relevant section in the Editor.
  2. Click the Open Inspector arrow  at the top right of the Editor.
  3. Scroll down to Layout.
  4. Click Switch next to Advanced CSS grid.
  5. Click Switch to CSS Grid.
A screenshot showing the option to switch to advanced grid in the Inspector panel
What's next?
Customize the rows, columns and spacing from the Inspector panel. You can also drag grid lines on the canvas to move them.  

Applying a CSS grid on other elements

You can apply a CSS grid to container, lightbox, flexbox and repeater items. Specifically in the repeater element, once you apply a grid to one item, the rest update automatically.

To apply a CSS grid:

  1. Select the relevant element in the Editor.
  2. Click the More Actions icon .
  3. Click Apply Advanced CSS Grid.
  4. Choose a layout from the 1x1 drop-down.
    Tip: Select Other if you want to set your own number of rows and columns. 
A screenshot showing the drop-down that you can click to choose another layout
What's next?
Customize the rows, columns and spacing from the Inspector panel. You can also drag grid lines on the canvas to move them.  

Customizing a CSS grid

Customize your grid to get the exact layout you want. You can change the number of rows and columns, adjust their size and the gaps between them.
Tip:
When designing a grid, it only applies on the specific breakpoint you're working on. You should tailor the grid to each breakpoint to ensure the composition of your elements is flawless. 

To customize a CSS grid:

  1. Select the relevant element or section.
  2. Choose how you want to customize the grid: 

Positioning elements in a grid

While adding elements to the grid, several tools can help you set their placement more accurately.

Docking elements

Docking elements to the gridlines ensures they're positioned exactly as you want. In the Studio Editor, all elements are automatically docked, but you can adjust the docking manually and add margins. 
GIF showing how to change the docking points of an element in a grid cell

Moving elements between grid cells

Under the Position section in the Inspector, you can select an element and see the grid cell it's in. Click any grid cell to move the element there, without having to use drag-and-drop. 
You can also enter the specific column and row numbers, which is useful when you need to place an element over multiple grid cells. 
A GIF showing how to click on other cells in the Inspector to quickly move elements between cells

Table of grid units

Use the whole range of CSS units to create your grid. You can set the size of the columns and rows using percentages, fractions or pixels. Alternatively, set the minimum and maximum size of the columns and rows, or use calculations to create the grid you require. 

Did this help?

|