Skip to content

Instantly share code, notes, and snippets.

@markmichon
Created May 28, 2013 19:07
Show Gist options
  • Save markmichon/5665267 to your computer and use it in GitHub Desktop.
Save markmichon/5665267 to your computer and use it in GitHub Desktop.
A CodePen by Mark Michon. Rotated Squares
<div class="logo">
<div class="pencil"></div>
</div>
@import "compass";
body {
padding: 50px;
}
.logo {
display: block;
width: 100px;
height: 100px;
background-color: #facade;
position: relative;
transform: rotate(-45deg);
}
.logo:before {
content: '';
position: absolute;
width: 100px;
height: 100px;
background-color: red;
display: block;
left:50px;
top:50px;
z-index:2;
}
.logo:after {
content: '';
position: absolute;
width: 50px;
height: 50px;
background-color: white;
display: block;
left:50px;
top:50px;
z-index:4;
}
.pencil {
width:0;
height:0;
position: absolute;
border:20px solid transparent;
border-left: 20px solid black;
transform: rotate(45deg);
left: 80px;
top: 80px;
z-index: 5;
border-radius: 20px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment