Building a hexagonal grid using CSS grid

Building a hexagonal grid using CSS grid

I've been chasing the idea of using (abusing?) CSS grid to build a interconnected hexagonal grid, where each hexagon fits together seamlessly.

I've been chasing the idea of using (abusing?) CSS grid to build a interconnected hexagonal grid, where each hexagon fits together seamlessly. An example of this would be a lot of tabletop war games, some board games (Settlers of Catan, for instance), and some computer games (I used to play The Battle for Wesnoth, it uses a system like this).

Here's the list of requirements I had going into this:

  • Must interconnect. This means a certain amount of overlap of the individual items, because we're fitting a hexagon into a square hole.
  • Must respect grid-gap, or allow for gutters of some kind. Preferably grid-gap.
  • Must be flexible. I need to be able to just throw a new item into it and have it just work.
  • Must be responsive. A grid that starts out at 5 across on larger screens should go down to one or two across on smaller screens.

grid css

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Building a layout with CSS Grid Setting rows columns sizes in CSS grid

Bite-sized screencasts and tips about React, CSS and Javascript. we will see the CSS grid auto-placement in action and how we can make a CSS layout to span the full height of the screen.

Hire CSS Developer

Want to develop a website or re-design using CSS Development? We build a website and we implemented CSS successfully if you are planning to **[Hire CSS Developer](https://hourlydeveloper.io/hire-dedicated-css-developer/ "Hire CSS Developer")**...

Creating a CSS Visual Cheatsheet

The other day one of our students asked about possibility of having a CSS cheatsheet to help to decide on the best suited approach when doing this or that layout.

The Guide to CSS Grid

In this article, we’re going to learn more about a powerful layout system for creating amazing and beautiful layouts on the web—we’re going to learn about CSS Grid. We’re going to understand why this technology was created and what exactly it is, what problems it helps us to solve, its similarities to Flexbox, and how it works in modern browsers to allow us to create powerful layouts without having to add a lot of extra CSS code. Let’s learn about the new system for creating two-dimensional layouts in CSS called CSS Grid, compare it to Flexbox and learn how to customize awesome layouts.

Super Hero Layout — Combining CSS Grid and CSS Shapes

Welcome to part four of the CSS Grid Layout series! In this part, we combine the techniques from our previous posts with CSS Shapes to create a comic book layout with uniquely shaped panels.