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

              
                <h1>backgroundで作るアンダーライン</h1>

<h2>色の変更</h2>
<p>・カラーコードで指定<span class="code">background: linear-gradient(transparent 0% 60%, #3F9629 60% 100%);</span></p><p class="example">テキストに<span class="under-line hex">アンダーライン</span>を引きます。</p>
<p>・色名称で指定<span class="code">background: linear-gradient(transparent 0% 60%, yellow 60% 100%);</span></p><p class="example">テキストに<span class="under-line color-name">アンダーライン</span>を引きます。</p>

<h2>太さの変更</h2>
<p>・細めの線<span class="code">background: linear-gradient(transparent 0% 80%, #FF57CD 80% 100%);</span></p><p class="example">テキストに<span class="under-line thin">アンダーライン</span>を引きます。</p>
<p>・太めの線<span class="code">background: linear-gradient(transparent 0% 40%, #FF57CD 40% 100%);</span></p><p class="example">テキストに<span class="under-line thick">アンダーライン</span>を引きます。</p>

<h2>位置の調整</h2>
<p>・paddingで下側に移動<span class="code">padding-bottom: 3px;</span></p><p class="example">テキストに<span class="under-line down">アンダーライン</span>を引きます。</p>

<h2>その他</h2>
<p>・下線の境界線をぼかす<span class="code">background: linear-gradient(transparent 0% 50%, #FF57CD 90% 100%);</span></p><p class="example">テキストに<span class="under-line gradation">アンダーライン</span>を引きます。</p>

<p>・複数の色を使う<span class="code">background: linear-gradient(transparent 0% 20%, yellow 40%, blue 100%);</span></p><p class="example">テキストに<span class="under-line style">アンダーライン</span>を引きます。</p>

              
            
!

CSS

              
                body {
  padding: 20px;
}

h2 {
  margin-top: 70px;
}

p {
  line-height: 1.5;
}

.code {
  margin-left: 5px;
  padding: 3px 6px;
  background: #ddd;
  color: #EC1B4B;
}

.example {
  margin-left: 40px;
}

.under-line {
  background: linear-gradient(to bottom, transparent 0% 60%, #FF57CD 60% 100%);
}

.hex {
  background: linear-gradient(transparent 0% 60%, #3F9629 60% 100%);
}

.color-name {
  background: linear-gradient(transparent 0% 60%, yellow 60% 100%);
}

.thin {
  background: linear-gradient(transparent 0% 80%, #FF57CD 80% 100%);
}

.thick {
  background: linear-gradient(transparent 0% 40%, #FF57CD 40% 100%);
}

.down {
  padding-bottom: 3px;
}

.style {
  background: linear-gradient(transparent 0% 20%, yellow 40%, blue 100%);
}

.gradation {
  background: linear-gradient(transparent 0% 50%, #FF57CD 90% 100%);
}

              
            
!

JS

              
                
              
            
!
999px

Console