Simple Website Framework

Flex Grid System

Monday April 20th, 2026

Written by Scary le Poo

Flex Grid System

The framework includes a lightweight flexbox grid system in css/flexgridsystem.css. It uses two core classes — row and column — to create responsive multi-column layouts that automatically stack on small screens.


Core Concept

Wrap columns in a row, and each child with column. Columns divide the available width equally by default and collapse to full width on screens narrower than 1000px.

<div class="row">
    <div class="column">First</div>
    <div class="column">Second</div>
    <div class="column">Third</div>
</div>

Auto-Dividing Columns

Add as many column divs as you need. The grid divides the space evenly.

1 column

1/1

2 columns

1/2
1/2

3 columns

1/3
1/3
1/3

4 columns

1/4
1/4
1/4
1/4

Fixed-Width Column Classes (col-1 to col-6)

Use col-X classes to pin one column to an exact fraction of 12, letting the remaining column fill the rest of the space.

col-1 + auto

1/12
11/12

col-2 + auto

2/12
10/12

col-3 + auto

3/12
9/12

col-4 + auto

4/12
8/12

col-5 + auto

5/12
7/12

col-6 + auto

6/12
6/12

Flex-Basis Utility Classes

For layouts where you want columns to have a minimum width before wrapping (rather than a strict fractional size), use the flex-basis-* classes. These set a flex-basis value in pixels, allowing columns to wrap to the next line when the container gets too narrow.

Class flex-basis value Typical use
flex-basis-600 600px Wide content blocks
flex-basis-500 500px Medium-wide content
flex-basis-400 400px Standard content blocks
flex-basis-300 300px Sidebar / footer columns
flex-basis-150 150px Small tiles or icons
flex-basis-auto auto Let content determine width

The footer column system uses flex-basis-300 by default.


Responsive Behaviour

At screen widths below 1000px, all column elements switch to min-width: 100%, stacking vertically. No extra classes are needed — this is the default behaviour for every column.


Class Reference

Class Description
row Flex container. Wraps columns. Apply to the parent div.
column Flex child. Grows and shrinks equally with siblings.
col-1col-6 Pins a column to 1–6 twelfths of the row width.
flex-basis-150 Sets flex-basis to 150px.
flex-basis-300 Sets flex-basis to 300px.
flex-basis-400 Sets flex-basis to 400px.
flex-basis-500 Sets flex-basis to 500px.
flex-basis-600 Sets flex-basis to 600px.
flex-basis-auto Sets flex-basis to auto.
Simple Website Framework

A lean, flat-file PHP framework with no database, no bloat, and no black boxes. Build something clean and keep control of every part of it.

Contribute on GitHub

Found a bug? Have an idea? The project is open source and contributions are welcome. Find it on GitHub.

Documentation

This site is the living documentation for the framework. Every feature is demonstrated in the place it's meant to be used. Start with the introduction or dive straight into the setup guide.