css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <h1>CSS Arrows/Triangles Combinations</h1>
<ol class="multiple-triangles">
   <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 class="diagonal-triangles">
   <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 straight-triangles">
   <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>Check out this other demo: <a href="https://codepen.io/ricardozea/pen/30a046dec7d990b1651931d0c1300f6b">CSS Shapes with Sass</a></p>
<hr>
<p>Created by <a href="http://ricardozea.design/" target="_blank" title="Link opens in a new tab">Ricardo Zea</a></p>
            
          
!
            
              //Color variables (need to go at the on top):
$MyBlack: #272822;
$r: #c03;
$g: #429032;
$b: #2963bd;
$y: #c90;

//======

//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;
   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;
   }
}

//Styling stuff not needed for demo

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
   background-image: radial-gradient(lighten($MyBlack, 5), $MyBlack 150%);
   color: white;
   text-align: center;
   font-family: "Trebuchet MS";
}
h1 { font-weight: 100; }
a,
a:visited {
   color: $b;
   transition: .3s;
}
a:hover {
   color: $y;
   text-decoration: none;
}
ol {
   display: flex;
   flex-wrap: wrap;
   padding: 10px 10px 10px 35px;
   margin: 60px;
   list-style-type: lower-alpha;
   border: #333 1px solid;
   background: $MyBlack;
   border-radius: 2px;
   box-shadow: 0 0 5px rgba(black, 0.2);
   position: relative;
   &::before {
      display: inline-block;
      width: 100%;
      padding: 5px 10px;
      border-radius: 2px;
      content: "yes";
      position: absolute;
      top: -32px;
      left: 0;
      text-align: left;
      background: #111;
   }
   li {
      margin-right: 70px;
      &:last-of-type { margin: 0; }
   }
   &.extra { padding-top: 30px; }
}
.multiple-triangles::before { content: "Multiple Triangles:"; }
.diagonal-triangles::before { content: "Diagonal Triangles:"; }
.straight-triangles::before { content: "Straight Triangles:"; }

hr {
   width: 90%;
   margin: 30px auto;
   border: none;
   border-top: #666 1px dotted;
}

.pos-ab-element {
   width: 23px;
   height: 165px;
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console