Building a hexagonal grid using CSS grid
Publikováno: 18.6.2020
I think of grids as arrangements of rectangles with vertical and horizontal lines running through. And they are, but that doesn’t mean we can’t still do clever things in how we place things on those grids and what we do with the elements afterwards.
In this demo by Jesse Breneman, a grid of hexagons is created by setting up the grid columns with math such that each block can span over three columns and two rows so that the blocks … Read article “Building a hexagonal grid using CSS grid”
The post Building a hexagonal grid using CSS grid appeared first on CSS-Tricks.
I think of grids as arrangements of rectangles with vertical and horizontal lines running through. And they are, but that doesn’t mean we can’t still do clever things in how we place things on those grids and what we do with the elements afterwards.
In this demo by Jesse Breneman, a grid of hexagons is created by setting up the grid columns with math such that each block can span over three columns and two rows so that the blocks overlap in a way that allows a clip-path
to be applied around them. This carves a block into a hexagon that is evenly spaced with the others. Very clever.
And, ha, that’s a hell of a domain name Jesse. Personally, I don’t know anything about blogging about CSS at a super cheesy domain name.
Direct Link to Article — Permalink
The post Building a hexagonal grid using CSS grid appeared first on CSS-Tricks.