cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmloctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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.

            
              <h1>CSS Arrows/Triangles Combinations</h1>
<ol>
  <li><div class="side1"></div></li>
  <li><div class="side2"></div></li>
  <li><div class="all4"></div></li>
  <li><div class="top-n-bottom"></div></li>
  <li><div class="left-n-right"></div></li>
  <li><div class="side1 vertical"></div></li>
  <li class="top-bottom-separated pos-ab-element">
    <div class="north"></div>
    <div class="south"></div>
  </li>
   <li class="west-east-separated pos-ab-element">
    <div class="west"></div>
    <div class="east"></div>
  </li>
</ol>
<ol>
  <li><div class="top-right"></div></li>
  <li><div class="bottom-right"></div></li>
  <li><div class="bottom-left"></div></li>
  <li><div class="top-left"></div></li>
</ol>
<ol class="extra">
  <li><div class="north"></div></li>
  <li><div class="east"></div></li>
  <li><div class="south"></div></li>
  <li><div class="west"></div></li>
</ol>
<p>Similar demo in CodePen: <a href="http://codepen.io/ricardozea/pen/30a046dec7d990b1651931d0c1300f6b">CSS Shapes with Sass</a></p>
<hr>
<p>Created by <a href="http://ricardozea.me/">Ricardo Zea</a></p>
            
          
!
            
              @import "compass/css3";

//Styling stuff, not needed for the demo
  //Sass/Compass stuff
  @import "compass/css3/images";
  $MyBlack: #272822;
  $r: #c03;
  $g: #429032;
  $b: #2963BD;
  $y: #c90;

* { @include box-sizing(border-box); }
html { height: 100%; }
body { @include background(radial-gradient(lighten($MyBlack,5%),$MyBlack 80%)); color:white; text-align: center; font-family: 'Trebuchet MS'; }
a, a:visited { color:$b;  }
a:hover { color:$y; text-decoration: none; }
ol { display: flex; flex-wrap: wrap; padding: 10px 10px 10px 35px; margin: 50px; list-style-type: lower-alpha; border: #333 1px solid; background: rgba($MyBlack,.5); border-radius:2px; box-shadow:0 0 5px rgba(black,.2);
  li { margin-right: 70px;
    &:last-of-type { margin: 0; }
  }
  &.extra { padding-top: 30px;}
}
//Clearfix - http://davidwalsh.name/css-clear-fix
.clearfix:before, .clearfix:after {	display: block;	content: ""; height: 0;	overflow: hidden; }
.clearfix:after { clear: both; }

//Demo stuff - Edit below this line
div { margin-bottom:20px;
  //Boxes or Triangle Combinations
  &.side1 {
    height:0;
    width:0;
    border-top:100px solid $r;
    border-right:100px solid $b;
    
    //Vertical
    &.vertical { transform:rotate(45deg); margin-top: 20px; }
  }
  
  &.side2 {
    height:0;
    width:0;
    border-bottom:100px solid $g;
    border-right:100px solid $y;
  }

  &.all4 {
    border-style: solid;
    border-width: 50px;
    border-bottom-color: $b;
    border-left-color: $g;
    border-top-color: $y;
    border-right-color: $r;
    height: 0;
    width: 0;
  }
  
  &.top-n-bottom {
    border-style: solid;
    border-width: 50px;
    border-bottom-color: $b;
    border-left-color: transparent;
    border-top-color: $y;
    border-right-color: transparent;
    height: 0;
    width: 0;
  }
  
  &.left-n-right {
    border-style: solid;
    border-width: 50px;
    border-bottom-color: transparent;
    border-left-color: $g;
    border-top-color: transparent;
    border-right-color: $r;
    height: 0;
    width: 0;
  }

  //Arrows - Diagonal
  &.top-right {
    height:0;
    width:0;
    border-top:100px solid $g;
    border-left:100px solid transparent;
  }
  
  &.bottom-right {
    height:0;
    width:0;
    border-bottom:100px solid $r;
    border-left:100px solid transparent;
  } 

  &.bottom-left {
    height:0;
    width:0;
    border-bottom:100px solid $b;
    border-right:100px solid transparent;
  }
  
  &.top-left {
    height:0;
    width:0;
    border-top:100px solid $y;
    border-right:100px solid transparent;
  }
  
  //Arrows - Straight
   &.north {
    height:0;
    width:0;
    border-top:100px solid $g;
    border-left:100px solid transparent;
    transform:rotate(-45deg);
  }
  
   &.east {
    height:0;
    width:0;
    border-bottom:100px solid $r;
    border-left:100px solid transparent;
    transform:rotate(-45deg);
  
    //Only needed for demo
    margin-left:-50px;
  }
  
  &.south {
    height:0;
    width:0;
    border-bottom:100px solid $b;
    border-right:100px solid transparent;
    transform:rotate(-45deg);
    
  //Only needed for demo  
    margin-top:-20px;
  }
  
  &.west {
    height:0;
    width:0;
    border-top:100px solid $y;
    border-right:100px solid transparent;
    transform:rotate(-45deg);
  }
}

//Top and Bottom separated  
.top-bottom-separated { position: relative; margin-right: 170px /* This margin-right is not really needed it's only for the demo. */;
  div { position: absolute; margin: 0; }
  .south { border-bottom:100px solid $y; top: 40px; }

  //Only needed for demo
  .north { margin-top:10px; }
}

//West and East separated
.west-east-separated { position: relative;
  div { position: absolute; margin: 0; }
 .east { border-bottom:100px solid $r; top: 28px; left: 10px; }

  //Only needed for demo
  .west { margin-top:10px; }
}

/*Not needed for demo*/
hr {
  width: 90%;
  margin: 30px auto;
  border: none;
  border-top: #666 1px dotted;
}

.pos-ab-element {
   width: 23px;
   height: 165px;
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console