Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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="gradient-box linear">
  <div class="linear-1">1</div>
  <div class="linear-2">2</div>
  <div class="linear-3">3</div>
  <div class="linear-4">4</div>
  <div class="linear-5">5</div>
  <div class="linear-6">6</div>
  <div class="linear-7">7</div>
  <div class="linear-8">8</div>
  <div class="linear-9">9</div>
  <div class="linear-10">10</div>
</div>
              
            
!

CSS

              
                .gradient-box {
  display: flex;
  flex-wrap: wrap;
  div {
    width: 100px;
    height: 100px;
    align-content: center;
    text-align: center;
    font-weight: bold;
    color: #ffffff;
    font-size: 20px;
    display: inline-block;
  }
}

.linear-1 {
  /* orangeからblueにグラデする。orange 0%, blur 100% と同じ挙動 */
  background: linear-gradient(orange, blue);
}
.linear-2 {
  /* 左から右にグラデする。to right = 90deg or 0.25turn と同じ挙動 */
  background: linear-gradient(to right, orange, blue);
}
.linear-3 {
  /* 45度回転した状態でグラデする。45deg = to right top or 0.125turn と同じ挙動 */
  background: linear-gradient(45deg, orange, blue);
}
.linear-4 {
  /* グラデ軸の開始点を10%, 終了点を50%にする。 */
  background: linear-gradient(orange 10%, blue 50%);
}
.linear-5 {
  /* 複数グラデ&各色の開始を指定 */
  background: linear-gradient(orange 10%, blue 50%, deeppink 100%);
}
.linear-6 {
  /* グラデ軸の開始と終了点が同じのため変化が急になる。指定数値が昇順じゃない場合も開始>終了となるので変化が急になる */
  background: linear-gradient(orange 30%, blue 30%);
}
.linear-7 {
  /* 変化の中心点を30%にする */
  background: linear-gradient(orange 0%, 30%, blue 100%);
}
.linear-8 {
  /* 左下に向かって複数グラデ */
  background: linear-gradient(to bottom right, orange 0% 20%, blue 20% 40%, deeppink 40% 60%, lime 60% 80%, yellow 80% 100%);
}
.linear-9 {
  /* 複数レイヤー(?)でのグラデ。透過箇所がない場合は最初に指定した色が表示される */
  background: linear-gradient(orange, transparent, transparent),
              linear-gradient(transparent, blue, transparent),
              linear-gradient(transparent, transparent, deeppink);
}
.linear-10 {
  /* 背景画像に対してのグラデ */
  background: linear-gradient(transparent, orange), url("https://i.imgur.com/djkvTYX.png") center no-repeat;
  background-size: contain;
}

              
            
!

JS

              
                
              
            
!
999px

Console