Skip to content

Instantly share code, notes, and snippets.

@antoniofrignani
Created July 3, 2013 18:49
Show Gist options
  • Save antoniofrignani/5921623 to your computer and use it in GitHub Desktop.
Save antoniofrignani/5921623 to your computer and use it in GitHub Desktop.
Rounded Hexagon [Modified] - source: http://css-tricks.com/snippets/css/hexagon-with-shadow/
.hexagon {
width: 120px;
height: 60px;
position: relative;
}
.hexagon, .hexagon:before, .hexagon:after {
background: red;
border-radius: 5px
}
.hexagon:before, .hexagon:after {
content: "";
position: absolute;
left: 23px;
width: 74px;
height: 70px;
-moz-transform: rotate(145deg) skew(22.5deg);
-webkit-transform: rotate(145deg) skew(22.5deg);
transform: rotate(145deg) skew(22.5deg);
}
.hexagon:before {
top: -35px;
}
.hexagon:after {
top: 35px;
}
.hexagon span {
position: absolute;
top: 0;
left: 0;
width: 120px;
height: 70px;
background:red;
z-index: 1;
}
body { padding: 100px; }
<div class="hexagon"><span></span></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment