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 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

              
                <div id="wrapper">
  <div id="browser"></div>
  <h1>SVG embedding</h1>

  <h2>Img</h2>

  <p>img tag with both <code>height</code> and <code>width</code> attributes:</p>
  <img src="http://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg" alt="Alert" height="200" width="200">
  <br>
  <code class="tag">
		&lt;img src=&quot;http://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg&quot; alt=&quot;Alert&quot; height=&quot;200&quot; width=&quot;200&quot;&gt;
	</code>

  <p>img tag with <code>width</code> attribute only:</p>
  <img src="http://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg" alt="Alert" width="200">
  <br>
  <code class="tag">
		&lt;img src=&quot;http://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg&quot; alt=&quot;Alert&quot; width=&quot;200&quot;&gt;
	</code>


  <h2>Object</h2>

  <p>object tag with both <code>height</code> and <code>width</code> attributes:</p>
  <object data="http://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg" type="image/svg+xml" width="200" height="200">
    <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/61/HTML5_logo_and_wordmark.svg/512px-HTML5_logo_and_wordmark.svg.png" alt="fallback" height="200">
  </object>
  <br>
  <code class="tag">
		&lt;object data=&quot;http://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg&quot; type=&quot;image/svg+xml&quot; width=&quot;200&quot; height=&quot;200&quot;&gt;<br>
	    	&lt;img src=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/6/61/HTML5_logo_and_wordmark.svg/512px-HTML5_logo_and_wordmark.svg.png&quot; alt=&quot;fallback&quot; width=&quot;200&quot;&gt;<br>
		&lt;/object&gt;
	</code>

  <p>object tag with <code>width</code> attribute only:</p>
  <object data="http://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg" type="image/svg+xml" width="200">
    <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/61/HTML5_logo_and_wordmark.svg/512px-HTML5_logo_and_wordmark.svg.png" alt="fallback" width="200">
  </object>
  <br>
  <code class="tag">
		&lt;object data=&quot;http://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg&quot; type=&quot;image/svg+xml&quot; width=&quot;200&quot;&gt;<br>
	    	&lt;img src=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/6/61/HTML5_logo_and_wordmark.svg/512px-HTML5_logo_and_wordmark.svg.png&quot; alt=&quot;fallback&quot; width=&quot;200&quot;&gt;<br>
		&lt;/object&gt;
	</code>


  <h2>Iframe</h2>

  <p>iframe tag with both <code>height</code> and <code>width</code> attributes:</p>
  <iframe src="http://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg" width="200" height="200">
    <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/61/HTML5_logo_and_wordmark.svg/512px-HTML5_logo_and_wordmark.svg.png" alt="fallback" height="200">
  </iframe>
  <br>
  <code class="tag">
		&lt;iframe src=&quot;http://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg&quot; width=&quot;200&quot; height=&quot;200&quot;&gt;<br>
	    	&lt;img src=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/6/61/HTML5_logo_and_wordmark.svg/512px-HTML5_logo_and_wordmark.svg.png&quot; alt=&quot;fallback&quot; width=&quot;200&quot;&gt;<br>
		&lt;/iframe&gt;
	</code>

  <p>iframe tag with <code>width</code> attribute only:</p>
  <iframe src="http://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg" width="200">
    <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/61/HTML5_logo_and_wordmark.svg/512px-HTML5_logo_and_wordmark.svg.png" alt="fallback" height="200">
  </iframe>
  <br>
  <code class="tag">
		&lt;iframe src=&quot;http://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg&quot; width=&quot;200&quot;&gt;<br>
	    	&lt;img src=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/6/61/HTML5_logo_and_wordmark.svg/512px-HTML5_logo_and_wordmark.svg.png&quot; alt=&quot;fallback&quot; width=&quot;200&quot;&gt;<br>
		&lt;/iframe&gt;
	</code>

  <p>iframe tag with <code>seamless</code> attributes</p>
  <iframe src="http://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg" width="200" width="200" seamless>
    <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/61/HTML5_logo_and_wordmark.svg/512px-HTML5_logo_and_wordmark.svg.png" alt="fallback" width="200">
  </iframe>
  <br>
  <code class="tag">
		&lt;iframe src=&quot;http://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg&quot; width=&quot;200&quot; height=&quot;200&quot; seamless&gt;<br>
	    	&lt;img src=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/6/61/HTML5_logo_and_wordmark.svg/512px-HTML5_logo_and_wordmark.svg.png&quot; alt=&quot;fallback&quot; width=&quot;200&quot;&gt;<br>
		&lt;/iframe&gt;
	</code>

  <h2>Embed</h2>

  <p>embed tag with both <code>height</code> and <code>width</code> attributes:</p>
  <embed src="http://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg" width="200" height="200"></embed>
  <br>
  <code class="tag">
		&lt;embed src=&quot;http://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg&quot; width=&quot;200&quot; height=&quot;200&quot;&gt;&lt;/embed&gt;
	</code>

  <p>embed tag with <code>width</code> attribute only:</p>
  <embed src="http://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg" width="200"></embed>
  <br>
  <code class="tag">
		&lt;embed src=&quot;http://upload.wikimedia.org/wikipedia/commons/6/61/HTML5_logo_and_wordmark.svg&quot; width=&quot;200&quot;&gt;&lt;/embed&gt;
	</code>
</div>
              
            
!

CSS

              
                #wrapper {
  padding: .5em;
  margin: 1em 3em;
  border: 1px solid #ddd;
  display: inline-block;
}

#browser {
  margin: 0 0 1em;
  color: #888;
  font-family: Helvetica, Arial, sans-serif;
  font-size: .8em;
  font-weight: normal;
  border-bottom: 1px solid #ddd;
}

img,
object,
iframe,
embed {
  background-color: rgba(0, 128, 0, 0.49);
  color: #fff;
}

code.tag {
  margin-bottom: 3em;
  display: block;
}
              
            
!

JS

              
                (function() {
  "use strict";

  //http://stackoverflow.com/questions/5916900/detect-version-of-browser
  function sayswho() {
    var ua = navigator.userAgent,
      tem,
      M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
    if (/trident/i.test(M[1])) {
      tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
      return 'IE ' + (tem[1] || '');
    }
    if (M[1] === 'Chrome') {
      tem = ua.match(/\bOPR\/(\d+)/);
      if (tem !== null) {
        return 'Opera ' + tem[1];
      }
    }
    M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?'];
    if ((tem = ua.match(/version\/(\d+)/i)) !== null) {
      M.splice(1, 1, tem[1]);
    }
    return M.join(' ');
  }

  document.getElementById('browser').innerHTML = sayswho() + ' (' + window.navigator.platform + ')' +
    '<br><small>' + window.navigator.userAgent + '</small>';

})();
              
            
!
999px

Console