cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <header>
  <h1>What a Beautiful Background!</h1>
  <div id="bg">
    <ul class="row">
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
    </ul>
    <ul class="row">
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
    </ul>
    <ul class="row">
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
    </ul>
    <ul class="row">
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
      <li class="pattern">
        <div id="top"></div>
        <div id="bottom"></div>
      </li>
    </ul>
  </div>
</header>
<section>
  <h1>A Quick Pen By HipsterBrown</h1>
  <p>Inspired by <a target="_blank" href="http://veerle.duoh.com/design/article/creating_geometric_patterns_in_illustrator"> Veerle Pieters</a></p>
</section>
            
          
!
            
              @import "bourbon";

* { 
 list-style: none;
 font-family: $helvetica;
 text-decoration: none;
 padding: 0;
 margin: 0;
}

@mixin triangle($color, $size, $direction: top) {
  @include size(0px);
  border-#{$direction}: $size*1.75 solid $color; 
  
  @if $direction == top or $direction == bottom {
    border-left: $size solid transparent;
    border-right: $size solid transparent;
  } @else if $direction == left or $direction == right {
    border-top: $size solid transparent;
    border-bottom: $size solid transparent; 
  } 
}

ul {
  li {
  display: inline-block; 
  }
}

header {
  width: 100%;
  height: 400px;
  overflow: hidden;
  opacity: 0.7;  
  padding: 0;
  white-space: nowrap;
  border-bottom: 15px solid black;
}

h1 {
  z-index: 13;
  position: absolute;
  display: inline-block;
  top: 250px;
  left: 10%;
  margin: 0;
  font-family: $helvetica;
  font-size: 1.75em;
  font-weight: 100;
  color: white;
  background: black;
  padding: 20px;
  section & {
    position: static;
    background: none;
    color: #5a5a5a;
  }
}

section {
  margin: 0 auto;
  width: 80%;
  text-align: center;
  font-family: $helvetica;
   a {
     color: #5a5a5a;
     &:hover {
       text-decoration: underline; 
    }
   }
}

.row {
  position: relative;
  margin: 0;
  z-index: 1;
  &:first-of-type {
    bottom: 80px !important;  
  }
  &:nth-of-type(even) {
    right: 107px;
    bottom:110px;
  }
  &:nth-of-type(odd) {
    bottom: 140px;
    right: 20px;
  }
  &:last-of-type {
    bottom: 170px;
  }
}

.pattern {
  $deg: 60deg;
  position: relative;
  margin-right: 70px;
  @include transform(rotate(30deg));
  #top {
    @include triangle(gold, 50px);
    margin: 0;
    //margin-top: -1px;
    &::before {
      content: "";
      @include triangle(orange, 50px);
      @include position(absolute, 0px 0px 0 0);
      @include transform(rotate($deg));
      @include transform-origin(left top);
    }
    &::after {
      content: "";
      @include triangle(red, 50px);
      @include position(absolute, 0px 0 0 0px);
      @include transform(rotate(-$deg));
      @include transform-origin(right top);
    }
  }
  #bottom {
    @include triangle(teal, 50px, bottom);
    margin: 0;
    &::before {
      content: "";
      @include triangle(skyblue, 50px, bottom);
      @include position(absolute, 0 0px 0px 50px);
      @include transform(rotate($deg));
      @include transform-origin(left bottom);
    }
    &::after {
      content: "";
      @include triangle(purple, 50px, bottom);
      @include position(absolute, 0 0px 0px -50px);
      @include transform(rotate(-$deg));
      @include transform-origin(right bottom);
    }  
  }
}

            
          
!
999px
Loading ..................

Console