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

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

              
                <h1>border-bottomで作るアンダーライン</h1>

<h2>色の変更(border-bottom-color)</h2>
<p>・指定なし<span class="code">(border-bottom-color: currentcolor;)</span></p><p class="example">テキストに<span class="under-line">アンダーライン</span>を引きます。</p>
<p>・色名で指定<span class="code">border-bottom-color: red;</span></p><p class="example">テキストに<span class="under-line color-name">アンダーライン</span>を引きます。</p>
<p>・カラーコードで指定<span class="code">border-bottom-color: #FF7403;</span></p><p class="example">テキストに<span class="under-line hex">アンダーライン</span>を引きます。</p>
<p>・rgbaで指定<span class="code">border-bottom-color: rgba(172, 54, 173, .5);</span></p><p class="example">テキストに<span class="under-line rgba">アンダーライン</span>を引きます。</p>

<h2>太さの変更(border-bottom-width)</h2>
<p>・指定なし<span class="code">(border-bottom-width: medium;)</span></p><p class="example">テキストに<span class="under-line">アンダーライン</span>を引きます。</p>
<p>・thinを指定<span class="code">border-bottom-width: thin;</span></p><p class="example">テキストに<span class="under-line thin">アンダーライン</span>を引きます。</p>
<p>・thickを指定<span class="code">border-bottom-width: thick;</span></p><p class="example">テキストに<span class="under-line thick">アンダーライン</span>を引きます。</p>
<p>・pxで指定<span class="code">border-bottom-width: 2px;</span></p><p class="example">テキストに<span class="under-line width-px">アンダーライン</span>を引きます。</p>
<p>・emで指定<span class="code">text-decoration-thickness: .2em;</span></p><p class="example">テキストに<span class="under-line width-em">アンダーライン</span>を引きます。</p>

<h2>位置の調整</h2>
<p>・指定なし</p><p class="example">テキストに<span class="under-line">アンダーライン</span>を引きます。</p>
<p>・paddingで下側に移動<span class="code">padding-bottom: 10px;</span></p><p class="example">テキストに<span class="under-line down">アンダーライン</span>を引きます。</p>
<p>・line-heightの調整で上側に移動<span class="code">display: inline-block; line-height: .3;</span></p><p class="example">テキストに<span class="under-line line-height">アンダーライン</span>を引きます。</p>
<p>・擬似要素で上側に移動</p><p class="example">テキストに<span class="up">アンダーライン</span>を引きます。</p>


<h2>スタイルの変更(border-bottom-style)</h2>
<p>・指定なし<span class="code">(border-bottom-style: none;)</span></p><p class="example">テキストに<span class="under-line none">アンダーライン</span>を引きます。</p>
<p>・solid<span class="code">border-bottom-style: solid;</span></p><p class="example">テキストに<span class="under-line solid">アンダーライン</span>を引きます。</p>
<p>・double<span class="code">border-bottom-style: double;</span></p><p class="example">テキストに<span class="under-line double">アンダーライン</span>を引きます。</p>
<p>・dotted<span class="code">border-bottom-style: dotted;</span></p><p class="example">テキストに<span class="under-line dotted">アンダーライン</span>を引きます。</p>
<p>・dashed<span class="code">border-bottom-style: dashed;</span></p><p class="example">テキストに<span class="under-line dashed">アンダーライン</span>を引きます。</p>

              
            
!

CSS

              
                body {
  padding: 20px;
}

h2 {
  margin-top: 70px;
}

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

.example {
  margin-left: 40px;
}

.under-line {
  border-bottom: solid;
}

.color-name {
  border-bottom-color: red;
}

.hex {
  border-bottom-color: #FF7403;
}

.rgba {
  border-bottom-color: rgba(172, 54, 173, .5);
}

.thin {
  border-bottom-width: thin;
}

.thick {
  border-bottom-width: thick;
}

.width-px {
  border-bottom-width: 2px;
}

.width-em {
  border-bottom-width: .4em;
}

.down {
  padding-bottom: 10px;
}

.line-height {
  display: inline-block;
  line-height: .3;
}

.up {
  position: relative;
}

.up:after {
  content: '';
  width: 7em;
  position: absolute;
  bottom: 5px;
  left: 0;
  border-bottom: solid;
}

.none {
  border-bottom-style: none;
}

.solid {
  border-bottom-style: solid;
}

.double {
  border-bottom-style: double;
}

.dotted {
  border-bottom-style: dotted;
}

.dashed {
  border-bottom-style: dashed;
}

              
            
!

JS

              
                
              
            
!
999px

Console