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

              
                <h1>My Awesome Heading</h1>

<img src="https://i.imgur.com/AX0gATA.jpg" />

<p>Bacon ipsum dolor sit amet chicken hamburger short ribs strip steak tenderloin, bresaola kevin fatback frankfurter. Pancetta t-bone ham hock, pork loin andouille sirloin pork chop kielbasa tongue. Flank shoulder porchetta chicken, short loin ham hock sausage frankfurter. Shank meatloaf porchetta short loin chicken, jowl tail flank frankfurter pig. Tri-tip biltong ribeye t-bone flank beef ribs landjaeger meatloaf tenderloin andouille drumstick kevin venison jerky. Pork chop pastrami bresaola jerky shank pork loin tail capicola venison beef ribs ham hock spare ribs filet mignon ham ribeye. Tail pork belly jerky, kielbasa tenderloin bacon ball tip short loin beef chuck prosciutto.</p>

<label for="styleSwitcher">Choose a style: </label>
<select id="styleSwitcher">
  <option value="normal">Normal</option>
  <option value="high-contrast">High Contrast</option>
  <option value="print">Print</option>
</select>
              
            
!

CSS

              
                /* Normal styles */
h1 {
  text-shadow: 2px 2px gray;
}

img {
  float: right;
  width: 250px;
  padding-left: 20px;
}
              
            
!

JS

              
                // Cross browser addEvent function by John Resig
// http://ejohn.org/blog/flexible-javascript-events/
function addEvent(obj, type, fn) {
  if (obj.attachEvent) {
    obj['e' + type + fn] = fn;
    obj[type + fn] = function() {
      obj['e' + type + fn](window.event);
    }
    obj.attachEvent('on' + type, obj[type + fn]);
  } else obj.addEventListener(type, fn, false);
}

function switchStyles() {
  var selectedOption = this.options[this.selectedIndex];
  console.log("You selected " + selectedOption.value);
}

var styleSwitcher = document.getElementById("styleSwitcher");
addEvent(styleSwitcher, "change", switchStyles);
              
            
!
999px

Console