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

              
                <main>
  <h1>Inline and Block-Level Code</h1>
  <p>
    Testing styles for code that appears inline with content as well as blocks of code.
  </p>
  <p>
    Updated 2 February 2016 with <a href="https://www.paciellogroup.com/blog/2016/02/short-note-on-improving-usability-of-scrollable-regions/">notes from Steve Faulkner on making scrolling bits keyboard friendly</a>.
  </p>
  <pre role="region" aria-label="Code sample; may scroll depending on viewport size." tabindex="0">main {
  width: 80%;
  margin: 1em auto;
  padding: 1em 2em;
  color: #000;
  background-color: rgba(255,255,255,.25);
  border: .07em solid rgba(0,0,0,.5);
  border-radius: .5em;
}  </pre>
  <p>
    Bacon ipsum dolor amet <code>hamburger venison ground round</code>, ham kielbasa magna dolor turducken ipsum brisket shank. Shank capicola boudin cow qui cupim id sirloin. Quis aliqua drumstick andouille veniam brisket sunt pork chop. <kbd>Alt</kbd> + <kbd>Prnt Scrn</kbd>. Pig pork chop id, beef ribs tenderloin turkey kielbasa sunt corned beef laboris quis brisket kevin short ribs drumstick. Pork pariatur velit ad tenderloin. Pancetta sirloin spare ribs corned beef prosciutto proident ut. Exercitation laboris pork belly picanha flank.
  </p>
  <p>
    This is some text. You can <kbd>Ctrl</kbd> + <kbd>C</kbd> and then <kbd>Ctrl</kbd> + <kbd>V</kbd>. Maybe a <kbd>Tab<span class="Unicode">↹</span></kbd> for good measure.
  </p>
  <pre role="region" aria-label="Code sample; may scroll depending on viewport size." tabindex="0">/* For any clicks, clear the focus class from the nav and all its descendants, essentially closing the menu when a user clicks/taps outside of it. */
$(document).click(function(e) {
  $("nav *, nav").removeClass("focus");
});

/* Manipulate focus classes in navigation. */
function classy(){
  $("nav *, nav").removeClass("focus");
  $("nav:focus").addClass("focus");
  $("nav a:focus").addClass("focus");
  $("nav a:focus").parentsUntil("body").addClass("focus");
}

/* Delay the assigning of classes to give the :focus a chance to catch up. There has to be a better way for this. */
$(document).keydown(function() {
  setTimeout(classy, 200);
});

/* Find the current page and add the aria-label to its site structure parent, which you should only use if you can't do this server-side in your CMS of choice. */
$(document).ready(function() {
  var el = $("a[aria-label^='Current Page']");
  var elParent = el.parent().parent().parent("li").children("a");
  var elTxt = elParent.text();
  elParent.attr("aria-label", "Current Section: " + elTxt);
});</pre>
  <p>
    Aute prosciutto pork chop shank. Proident rump shank elit labore mollit sint brisket sausage culpa ham hock ipsum ullamco lorem fatback. Frankfurter ea commodo, ground round ham hock drumstick aliqua excepteur eiusmod picanha brisket lorem tenderloin sint strip steak. Sint aliquip leberkas, aliqua meatloaf swine id esse shank labore commodo fugiat porchetta. Salami proident capicola, rump ut pariatur sint sausage flank reprehenderit ground round. Sunt id ball tip, duis labore tail excepteur andouille do beef beef ribs aute rump sint. Dolore veniam kielbasa ullamco ad pork loin.
  </p>
  <p>
    Ut tempor velit ad. Voluptate excepteur pastrami duis magna. Tail cupim voluptate excepteur officia hamburger corned beef qui in bacon est ball tip irure proident. Et kielbasa id magna eiusmod sint exercitation nostrud quis meatloaf elit landjaeger. Cow sint venison velit elit nulla. Cillum andouille pig et meatloaf.
  </p>
  <pre>
Testing an overflowing box with no keyboard support.

Laborum non ut, bresaola ground round elit ut swine leberkas.
Ea officia short loin swine.
Quis salami flank sint, do in ham hock anim tenderloin meatloaf dolore elit.
Deserunt turducken non kielbasa est ad aute quis aliquip fatback ball tip laboris ham hock in prosciutto.
Hamburger andouille pork loin reprehenderit meatloaf, ut swine porchetta pastrami veniam ham hock doner rump ad labore.</pre>
  <p>
    Frankfurter jerky shank tail ball tip biltong duis ground round chicken. Turducken meatloaf pork chop sausage mollit reprehenderit ball tip ribeye short ribs frankfurter hamburger salami. Pastrami ham hock eu leberkas pork belly boudin, consequat velit cow spare ribs irure dolore frankfurter. Meatball bresaola adipisicing shank. Ad pork loin consectetur, jowl boudin tempor swine nostrud ex. Pancetta fatback ut chicken cupidatat, sirloin eiusmod. Shank duis pork chop, dolore ham doner voluptate pork belly.
  </p>
</main>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Lato:400,700);
@import url(https://fonts.googleapis.com/css?family=Linden+Hill);
@import url(https://fonts.googleapis.com/css?family=VT323);

body {
  background-color: #6D695C;
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAACVBMVEUAAAAAAAAAAACDY+nAAAAAA3RSTlMmDQBzGIDBAAAAG0lEQVR42uXIIQEAAADCMHj/0NdkQMws0HEeAqvwAUGJthrXAAAAAElFTkSuQmCC);
  font-size: 100%;
  color: #fff;
  font-family: Lato, Arial, sans-serif;
  padding: 0;
  margin: 0;
  line-height: 1.4;
}

main {
  width: 80%;
  margin: 1em auto;
  padding: 1em 2em;
  color: #000;
  background-color: rgba(255,255,255,.25);
  border: .07em solid rgba(0,0,0,.5);
  border-radius: .5em;
}

a {
  color: #009;
}

h1 {
  font-weight: normal;
  font-family: 'Linden Hill', serif;
  margin: .5em 0 0 0;
  padding: 0;
  font-size: 200%;
}

kbd {
  border: 1px solid #aaa;
  border-radius: 0.2em;
  box-shadow: 0.1em 0.2em 0.2em rgba(0,0,0,.5);
  background-color: #f9f9f9;
  background-image: linear-gradient(to bottom, #eee, #f9f9f9, #eee);
  padding: 0.1em 0.3em;
  /*font-family: inherit;*/
  font-family: Courier, "Courier New", monospace;
  font-size: 90%;
  color: #000;
  white-space: nowrap;
}

code, pre {
  font-family: 'VT323', 'Courier New', Courier, monospace;
  font-size: 110%;
  font-weight: normal;
  color: rgba(255, 176, 0, 0.6);
  background-color: #333;
  background-image: linear-gradient(to bottom, #222, #222 50%, #000 50%, #000);
  background-size: 100% 2px;
  padding: .05em .5em;
  text-shadow: rgba(185,128,0,.2) .5em 0 .2em;
}

pre {
  border: .07em solid #222;
  box-sizing: border-box;
  padding: .5em 1em;
  overflow: auto;
  box-shadow: inset 0 0 4em rgba(0,0,0,.5);
  border-radius: 1em;
  background-image: linear-gradient(to bottom, rgba(255,255,255,.05), rgba(255,255,255,.15) .5em, rgba(255,255,255,.05) 2em, rgba(255,255,255,.05) 2em, rgba(255,255,255,0)),
    /*linear-gradient(to left, rgba(255,255,255,.2), rgba(255,255,255,.05) 1em, rgba(255,255,255,.05) 1em, rgba(255,255,255,0)),*/
    linear-gradient(to bottom, #222, #222 50%, #000 50%, #000);
  background-size: /*100% 100%,*/ 100% 100%, 100% 2px;
}

code {
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

pre:focus {
  outline: .2em solid #0ff;
}
              
            
!

JS

              
                
              
            
!
999px

Console