Skip to content

Instantly share code, notes, and snippets.

@kennyledet
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennyledet/971831ea05eb6faa5d62 to your computer and use it in GitHub Desktop.
Save kennyledet/971831ea05eb6faa5d62 to your computer and use it in GitHub Desktop.
Draw 4 diamonds (really rotated circles) inside 1 larger diamond using the power of CSS; uses Bootstrap for col spacing
<style>
/* Diamond Hack CSS */
.diamond {
width: 160px;
height: 160px;
-ms-transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
overflow: hidden;
border: 2px solid #000000;
margin: 0 0 0 0;
padding: 0 0 0 0;
}
.inner-diamond {
width: 80px;
height: 80px;
overflow: hidden;
border: 2px solid #000000;
margin: 0 0 0 0;
padding: 0 0 0 0;
}
/* end Diamond Hack CSS */
}
<!-- Diamond Hack
It's just 2 rows of inner squares inside a larger square all rotated with CSS
-->
<div class="diamond">
<div class="diamond-row row">
<div style="margin-left: 11px;" class="inner-diamond col-xs-6"></div>
<div class="inner-diamond col-xs-6"></div>
</div>
<div class="diamond-row row">
<div style="margin-left: 11px;" class="inner-diamond col-xs-6"></div>
<div class="inner-diamond col-xs-6"></div>
</div>
</div>
<!-- / Diamond Hack -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment