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

              
                <h1>SVG example</h1>
<h2>Using SVG Symbol</h2>
<svg style="display:none" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <symbol id="umbrella" viewBox="0 0 596 597">
    <title>Umbrella</title>
    <desc>Umbrella icon</desc>
    <path class="shaft" d="M260.4,335.7 L260.4,478 C260.4,543.1 313.4,596.1 378.5,596.1 C443.6,596.1 496.6,543.1 496.6,478 C496.6,457.5 479.9,440.8 459.4,440.8 C438.9,440.8 422.2,457.5 422.2,478 C422.2,502.2 402.7,521.7 378.5,521.7 C354.3,521.7 334.8,502.2 334.8,478 L334.8,335.7 L260.4,335.7 L260.4,335.7 Z"></path>
    <path class="fabric" d="M558,335.7 C578.5,335.7 595.2,319 595.2,298.5 L595.2,294.8 C593.4,132 460.4,0.9 297.6,0.9 L297.6,0.9 C133.9,0.9 0,134.8 0,298.5 C0,319 16.7,335.7 37.2,335.7 L558,335.7 L558,335.7 Z M77.2,261.3 C94.9,156.2 187,75.3 297.6,75.3 C408.2,75.3 500.4,156.2 518,261.3 L77.2,261.3 L77.2,261.3 Z"></path>
  </symbol>
</svg>

<div class="text1">
  1. The icon
  <svg aria-labelledby="umbrella1" role="img">
    <use xlink:href="#umbrella">
      <title id="umbrella1">Umbrella</title>
    </use>
  </svg>
  means that it&rsquo;s raining
</div>

<div class="text2">
  2. The icon
  <svg aria-labelledby="umbrella2" role="img">
    <use xlink:href="#umbrella">
      <title id="umbrella2">Umbrella</title>
    </use>
  </svg>
  means that it&rsquo;s raining
</div>

<div class="text3">
  3. The icon
  <svg aria-labelledby="umbrella3" role="img">
    <use xlink:href="#umbrella">
      <title id="umbrella3">Umbrella</title>
    </use>
  </svg>
  means that it&rsquo;s raining
</div>

<h2>Using inline SVG</h2>
<div class="text3">
  4. The icon
  <svg aria-labelledby="umbrella4" role="img" viewBox="0 0 596 597">
    <title id="umbrella4">Umbrella</title>
    <desc>Umbrella icon</desc>
    <path class="shaft" d="M260.4,335.7 L260.4,478 C260.4,543.1 313.4,596.1 378.5,596.1 C443.6,596.1 496.6,543.1 496.6,478 C496.6,457.5 479.9,440.8 459.4,440.8 C438.9,440.8 422.2,457.5 422.2,478 C422.2,502.2 402.7,521.7 378.5,521.7 C354.3,521.7 334.8,502.2 334.8,478 L334.8,335.7 L260.4,335.7 L260.4,335.7 Z"></path>
    <path class="fabric" d="M558,335.7 C578.5,335.7 595.2,319 595.2,298.5 L595.2,294.8 C593.4,132 460.4,0.9 297.6,0.9 L297.6,0.9 C133.9,0.9 0,134.8 0,298.5 C0,319 16.7,335.7 37.2,335.7 L558,335.7 L558,335.7 Z M77.2,261.3 C94.9,156.2 187,75.3 297.6,75.3 C408.2,75.3 500.4,156.2 518,261.3 L77.2,261.3 L77.2,261.3 Z"></path>
  </svg>
  means that it&rsquo;s raining
</div>
              
            
!

CSS

              
                body {
  background-color: #fff;
  font-size: 16px;
}

h2 {
  background-color: #eee;
  padding: .2em;
  margin: 2em 0 1em;
}
h1 +h2 {
  margin-top:0;
}

div {
  margin-top: 1rem;
}

.text1 {
  font-size: 1em;
}

.text2 {
  font-size: 1.5em;
}

.text3 {
  font-size: 2em;
}

div svg {
  display: inline-block;
  height: 1em;
  width: 1em;
  vertical-align: baseline;
  margin: 0;
}

.text2 svg {
  fill: #408000;
}

.text3 .fabric {
  fill: #c00;
}

.text3 .shaft {
  fill: #0080ff;
}
              
            
!

JS

              
                
              
            
!
999px

Console