Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="wrapper">
<h2>borderだけで三角形ができる仕組み</h2>
<div class="triangle-step01"></div>
<div class="triangle-step02"></div>
<div class="triangle-step03"></div>
<div class="triangle-step04"></div>
<div class="triangle-step05"></div>
<hr>
<h2>上下左右向きの三角形<h2>
<h3>①上向きの三角形<h3>
<div class="group">
  <div class="triangle-pattern01"></div>
  <div class="triangle-pattern01-2"></div>
  <div class="triangle-pattern01-3"></div>
  <div class="triangle-pattern01-4"></div>
</div>
<h3>②右向きの三角形<h3>
<div class="triangle-pattern02"></div>
<h3>③下向きの三角形<h3>
<div class="triangle-pattern03"></div>
<h3>④左向きの三角形</h3>
<div class="triangle-pattern04"></div>
<hr>
<h2>斜め方向(右上・右下・左下・左上)の三角形<h2>
<h3>⑤右上向きの三角形</h3>
<div class="group">
<div class="triangle-pattern05"></div>  
<div class="triangle-pattern05-2"></div>
<div class="triangle-pattern05-3"></div>
<div class="triangle-pattern05-4"></div>
<div class="triangle-pattern05-5"></div>
</div>
<h3>⑥右下向きの三角形</h3>
<div class="group">
<div class="triangle-pattern06"></div>
<div class="triangle-pattern06-2"></div>
<div class="triangle-pattern06-3"></div>
</div>
<h3>⑦左下向きの三角形</h3>
<div class="group">
<div class="triangle-pattern07"></div>
<div class="triangle-pattern07-2"></div>
<div class="triangle-pattern07-3"></div>
</div>
<h3>⑧左上向きの三角形</h3>
<div class="group">
<div class="triangle-pattern08"></div>
<div class="triangle-pattern08-2"></div>
<div class="triangle-pattern08-3"></div>
</div>
</div>
              
            
!

CSS

              
                /* base
----------------------------------------------------*/
*{
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
html {
  font-size: 87.5%;
  font-family: "Roboto","ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", Osaka, "メイリオ", Meiryo, "MS Pゴシック", "MS PGothic", sans-serif;
  line-height: 1.6;
  letter-spacing: .05em;
}
body {
  font-size: 14px;
  font-size: 1rem;
}
h2{
  font-weight:normal;
}
h3{
  font-weight:normal;
  margin-top: 0;
}
.wrapper{
  margin: 0 auto;
  width: 712px;
}
div[class^=demo]{
  margin-bottom: 5rem;
}
.sample{
  border-left: 3px solid #ddd;
  padding: 10px 0 10px 20px;
  margin-left: 10px;
}
div{
  margin-bottom: 3em;
}
hr{
  border-color: #ddd;
  height: 0;
}
/* step
----------------------------------------------------*/
[class*="triangle"]{
  width:0;
  height:0;
}
.group:after{
  clear:both;
  display:table;
  content: "";
}
.group>div{
  float:left;
  margin: 0 50px 0 0;
}
.triangle-step01{
  width: 100px;
  height: 100px;
  border-top: 10px solid #F0897F;
}
.triangle-step02{
  width: 100px;
  height: 100px;
  border-top: 10px solid #F0897F;
  border-right: 10px solid #f6da69;
}
.triangle-step03{
  width: 100px;
  height: 100px;
  border-top: 20px solid #F0897F;
  border-right: 20px solid #f6da69;
  border-bottom: 20px solid #b2ce54;
  border-left: 20px solid #6aa7cd;
  
}
.triangle-step04{
  border-top: 50px solid #F0897F;
  border-right: 50px solid #f6da69;
  border-bottom: 50px solid #b2ce54;
  border-left: 50px solid #6aa7cd;
}
.triangle-step05{
  border-top: 50px solid #F0897F;
  border-right: 50px solid transparent;
  border-bottom: 50px solid transparent;
  border-left: 50px solid transparent;
}
/* -------------------------------------- */
.triangle-pattern01{
  border-right: 50px solid transparent;
  border-bottom: 50px solid #b2ce54;
  border-left: 50px solid transparent; 
}
.triangle-pattern01-2{
  border-right: 50px solid transparent;
  border-bottom: 100px solid #b2ce54;
  border-left: 50px solid transparent; 
}
.triangle-pattern01-3{
  border-right: 50px solid transparent;
  border-bottom: 20px solid #b2ce54;
  border-left: 50px solid transparent; 
}
.triangle-pattern01-4{
  border-right: 50px solid transparent;
  border-bottom: 86.6025px solid #b2ce54;
  border-left: 50px solid transparent; 
}
.triangle-pattern02{
  border-top: 50px solid transparent;
  border-bottom: 50px solid transparent;
  border-left: 50px solid #6aa7cd;
}
.triangle-pattern03{
  border-top: 50px solid #F0897F;
  border-right: 50px solid transparent;
  border-left: 50px solid transparent;
}
.triangle-pattern04{
  border-top: 50px solid transparent;
  border-right: 50px solid #f6da69;
  border-bottom: 50px solid transparent;
}
.triangle-pattern05{
  border-top: 50px solid #F0897F;
  border-right: 50px solid #f6da69;
  border-bottom: 50px solid transparent;
  border-left: 50px solid transparent;
}
.triangle-pattern05-2{
  border-top: 50px solid #F0897F;
  border-left: 50px solid transparent;
}
.triangle-pattern05-3{
  border-right: 50px solid #f6da69;
  border-bottom: 50px solid transparent;
}
.triangle-pattern05-4{
  border-top: 30px solid #F0897F;
  border-right: 30px solid #f6da69;
  border-bottom: 70px solid transparent;
  border-left: 70px solid transparent;
}
.triangle-pattern05-5{
  border-top: 70px solid #F0897F;
  border-right: 70px solid #f6da69;
  border-bottom: 30px solid transparent;
  border-left: 30px solid transparent;
}
.triangle-pattern06{
  border-top: 50px solid transparent;
  border-right: 50px solid #f6da69;
  border-bottom: 50px solid #b2ce54;
  border-left: 50px solid transparent;
}
.triangle-pattern06-2{
  border-top: 50px solid transparent;
  border-right: 50px solid #f6da69;
}
.triangle-pattern06-3{
  border-bottom: 50px solid #b2ce54;
  border-left: 50px solid transparent;
}
.triangle-pattern07{
  border-top: 50px solid transparent;
  border-right: 50px solid transparent;
  border-bottom: 50px solid #b2ce54;
  border-left: 50px solid #6aa7cd;
}
.triangle-pattern07-2{
  border-right: 50px solid transparent;
  border-bottom: 50px solid #b2ce54;
}
.triangle-pattern07-3{
  border-top: 50px solid transparent;
  border-left: 50px solid #6aa7cd;
}
.triangle-pattern08{
  border-top: 50px solid #F0897F;
  border-right: 50px solid transparent;
  border-bottom: 50px solid transparent;
  border-left: 50px solid #6aa7cd;
}
.triangle-pattern08-2{
  border-bottom: 50px solid transparent;
  border-left: 50px solid #6aa7cd;
}
.triangle-pattern08-3{
  border-top: 50px solid #F0897F;
  border-right: 50px solid transparent;
}

              
            
!

JS

              
                
              
            
!
999px

Console