Minimal and straight-forward CSS grid system utilizing descriptive HTML rather than semantic CSS.
<grid columns=8> <c></c> <c span=3>3</c> <c></c> <c span=7-8>7-8</c> <c span=2+2>2+2</c> <c span=5-8>5-8</c> <c span=1-4>1-4</c> <c span=6..>6..</c> <c span=2..>2..</c> <c span=4..>4..</c> <c span=1-2>1-2</c> <c span=4-5>4-5</c> </grid>
The number of columns a grid has is specified by the
For instance, to define a grid with 8 columns, you'd write
Cells span a single column by default.
span attribute is used to customize where a cell
starts and how many columns it spans.
<c span=2-5> starts in column 2 and ends in column 5.
A cell with an empty or missing
span attribute starts on
the next available column and spans one column.
The HTML here is what generates the grid you see at the top of this page.
end in column 5.
span 3 columns.
span remainder of row.
span 2 columns.
<grid columns=6> <c span=2 span-s=row> <c span=3-6 span-s=row> <c span=1-2 span-s=1> <c span=3.. span-s=2..> </grid>
Grids lend themselves really well to device-size responsive design.
span-s attribute defines alternate layout when your
design is presented on a small screen.
This makes designing for large and small screens really easy.
Tap the example above—or resize your web browser window—to see the
Showing large screen.
span-l attribute can be used to control
an alternate layout for really large screens.
This entire website is built with grids and changes layout when the window size passes 600dp.
columns-s=3> <c> <c span=2> <c> <c span=2> </grid>
columns-s is available
grid tags for alternate layout on small screens.
Often a small-screen layout can be accomplished by simply setting
columns-s without the need for any
columns-l attribute is also available
for large screens.
Tap the example above—or resize your web browser window—to see the layout change. Showing large screen.
Raster is a complete CSS framework for creating websites.
The Raster system is minimal but holistic:
--fontSize: 18pxto change the entire scale of your website, or fine-tune spacing of various elements using the
--lineHeightvariable, which is the basis for all lengths.
provides the minimal set of
If you're looking for a wholesome framework, use raster.css instead.
This CSS generator is also available as a script: generate-grid.js
Raster is an open-source project and the source code is available on GitHub →