Letters with CSS
The alphabet drawn in pure CSS, with the code for every letter to copy.
Letters
26, A to Z
Made with
Pure CSS
GitHub stars
1
What I set out to do
In 2021, before AI tools could write CSS for you, I wanted to properly learn four CSS techniques: pseudo-elements, borders and box-shadow, positioning, and transforms. Reading about them only got me so far, so I gave myself a project that would make me use all four again and again: draw every capital letter of the English alphabet with them, and nothing else.
What I built
Twenty-six capital letters, A to Z, each drawn with one or two plain HTML elements and CSS alone. No images, SVG, or fonts.
- Pseudo-elements (
::beforeand::after) add the extra strokes a single element can't make. - Borders and box-shadow draw strokes, curves, and the holes inside letters like O and D.
- Positioning places each piece exactly where it belongs.
- Transforms rotate and skew the diagonals in letters like A, N, and W.
Every letter started as a puzzle: what's the fewest shapes that still reads as this letter? On the live site, select any letter to see it large, with its HTML and CSS ready to copy. Each letter also has its own link, so you can share the exact one you're looking at.
Who it's for
Anyone learning CSS who wants to see how far a few techniques can go. Open any letter, copy its HTML and CSS into your own page, and change one line at a time to see what it does. Each letter's colour comes from a single variable, so it's easy to make it your own.
Where it is now
Complete. All 26 letters are drawn, with the code for each one on the live site, shown below.