Skip to content

Instantly share code, notes, and snippets.

@LeaVerou
Created February 23, 2013 20:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save LeaVerou/5021208 to your computer and use it in GitHub Desktop.
Save LeaVerou/5021208 to your computer and use it in GitHub Desktop.
Hexagon kitty - By @LeaVerou
/* Hexagon kitty - By @LeaVerou
Disappointingly inflexible, but still interesting methinks.
*/
.hexagon {
display: inline-block;
position: relative;
width: 200px;
height: 200px;
transform: scale(1.25,.707) rotate(-45deg);
overflow: hidden;
backface-visibility: hidden; /* hack to make it smoother, suggested by */
}
.hexagon > img {
position: absolute;
transform: rotate(45deg) scale(.8, 1.404);
clip: rect(0,187px,200px,13px);
}
<img src="http://placekitten.com/200/200" />
<div class="hexagon"><img src="http://placekitten.com/200/200" /></div>
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"javascript"}
@3emad
Copy link

3emad commented Feb 28, 2013

I just love placekitten!!fun to use it for testing things!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment