28 comments

[ 4.4 ms ] story [ 67.8 ms ] thread
If you're willing to sacrifice IE7 support, you can accomplish that all with one element per haxagon, as well, by utilizing the :before and :after pseudo-elements.
yeah, I was thinking of exploring that next and will update the page when I do so.
now updated thanks to Will Hardy
haha! I might have to add mention of that to my article too :-)
That's neat. Too bad it doesn't work on Windows, though.
Works fine for me. Windows 7 64-bit, Firefox 11.0
I have the exact same and I don't see it.
This is the winner. Clean edges, simple implementation.
You can't trust the size of a font symbol though.
Not rendering for me, running Windows 7 and chrome
Win 7 + chrome here too; the URL of the parent of your note renders it ok, but not on the OP for me.
Compatibility with unicode is strictly the font? If the font is installed it doesn't matter the machine, doctype or browser?
Tantek Çelik did some of this experimentation, amazingly, over a decade ago (2001). Right-click for his CSS:

"A Study of Regular Polygons" http://tantek.com/CSS/Examples/polygons.html

Nice! His hexagon appears to only need two elements too.
These tricks with CSS are all nice. Pardon my ignorance, though, if one needs a way to draw shapes wouldn't something like SVG be more suitable for these sort of tasks? I know it is probably not as easy as with CSS (support is more limited as well), but isn't this example kinda like abusing the limits of the stylesheets?
Is it possible to bind an image to these instead of a straight color?
The power of the hexagon in css! I've seen some interesting art built out of triangles and render very well in all browsers and together with hexagons you can build complex geo art. Here's a favorite of mine: http://www.ragestorm.net/erezsh/parrot.html
(comment deleted)
Clever. I'm going to play around with this now.