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.
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?
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
28 comments
[ 4.4 ms ] story [ 67.8 ms ] threadhttp://www.fileformat.info/info/unicode/char/2b22/index.htm
"A Study of Regular Polygons" http://tantek.com/CSS/Examples/polygons.html
Wayback: http://web.archive.org/web/20020321021851/http://tantek.com/...
It is very Q'n'D and cumbersome but at least it has novelty value.
http://twitter.github.com/bootstrap/components.html#buttonDr...
If you inspect the down arrow it's created in the same way. Interesting.
I guess it's better than an extra image request if you don't mind the style.
http://lab.smashup.it/flip/
And here someone produced a clever 3d animation using borders:
http://www.uselesspickles.com/triangles/
http://css-tricks.com/examples/ShapesOfCSS/
Includes the infinity symbol, an egg, Pac-man, and the ever fun Yin-Yang symbol.