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

              
                <div class="example">
<div class="editor" contenteditable spellcheck="false" role="textbox" aria-multiline="true">
  <h1 id="p1">Priority 1</h1>
  <p>The word <span role="mark">fish</span> is highlighted.</p>
  <p>The word <mark class="commented-text" aria-details="thread-1">cat</mark> has a comment tied to it.</p>
  <p>Suggestion: We shall eat <span role="suggestion" aria-details="thread-2"><del>oranges</del><ins>clementines</ins></span>.</p>
  <p>Revision 1 has some text <del>removed</del>, other text <ins>added</ins> and of course some <del>changed</del><ins>replaced</ins>.</p>
  <p>The word <span aria-invalid="spelling">smarple</span> is misspelled.</p>
  <p>There is a grammar error in <span aria-invalid="grammar">these</span> paragraph.</p>
  <p>The word <mark>fishtank</mark> is highlighted.</p>
  <p>The word snotface<span aria-details="thread-3"><del>, however,</del></span> was considered inflammatory.</p>
  <p>It's possible to <mark aria-details="thread-1 thread-4 thread-5">point</mark> to multiple comments.</p>
  <p>It's possible to point to a group or region of comments ... <mark aria-details="comment-region">don't expect sensible comments here</mark>.</p>

  <h1 id="p2">Priority 2</h1>
  <p role="doc-subtitle">Once more unto the breach</p>

  <div role="doc-toc">
    <h3>Table of Contents -- usually would come earlier in document.</h3>
    <p>Treat TOC as a landmark.</p>
    <ul>
      <li><a href="#p1">Priority 1 items</a></li>
      <li><a href="#p2">Priority 2 items</a></li>
      <li><a href="#p3">Priority 3 items</a></li>
    </ul>
  </div>
    <div role="group" aria-label="Other users here now">
    <p><span id="presence-1" </span></p>
  </div>

  <p><span aria-description="User nearby, Boaty McBoatface">Here is a sentence that is being edited by someone else.</span> Multiple authors can edit this document at the same time.</p>
  <code style="display:block; white-space: pre; border: 2px solid black; margin: 5px;">// Here is some code with a conditional breakpoint inside the loop:
for (index = 0; index &lt; 10; index ++) {
<span role="mark" class="breakpoint" aria-roledescription="breakpoint" aria-description="Condition: index == 2">  doSomething(index);</span>
}
  </code>
  <p>This content has a footnote<span role="doc-noteref" aria-details="footnote-1">1</span></p>
  <p>Some random text with a <sub>subscript</sub> and <sup>superscript</sup>.</p>
  <p>This is a paragraph that straddles the page break (and footnotes, footer and header). This paragraph actually</p>
    <!-- We skip role=doc-backlink because, for consistency, we should always use aria-details.
    Backlink would create a requirement to actually be a link because it's exposed via IA2 as a link.
    By using aria-details on the source element we automatically get the reverse relation.
    -->
  <aside role="doc-footnote"><sup>1</sup> <span>Footnotes are useful and occasionally funny. Page break below this text.</span></aside>

  <div role="doc-pagefooter">This is a running footer<span style="float:right">1</span></div>

  <hr role="doc-pagebreak">

  <div role="doc-pageheader">This is a running header<span style="float:right">Some author's name here</div>
  <p>continues on the next page.</p>
  <h1 id="p3">Priority 3 (this is page 2)</h1>
  <!-- TBD: we need browser and AT implementations for running headers/footers: https://github.com/w3c/dpub-aam/issues/3  -->
  <p>Some page 2 content.</p>
  <p>Column text then a column break.<span role="separator" aria-roledescription="Column break" class="colbreak">&nbsp;</span>Do we want to expose column breaks? Could be annoying to read.</p>

  <!-- TBD: we need browser and AT implementations for running headers/footers: https://github.com/w3c/dpub-aam/issues/3 -->
  <div role="doc-pagefooter">This is a running footer. In the future we'd like to have a built-in role for this rather than using a role descripton.</div>
</div>

<div id="comment-region" class="sidebar" role="region">
  <h2>Comments</h2>
  <div id="thread-1" role="comment">
    Cats are liquid BTW<br>&mdash;Danny Ainge
    <div role="comment">
      No they aren't<br>&mdash;Magic Johnson
    </div>
    <div role="form">
      <textarea cols="80" placeholder="Add reply..."></textarea>
      <input type="submit">
    </div>
  </div>

  <div id="thread-2" role="comment">
    Replaced "oranges" with "clementines"<br>&mdash;Kevin McHale
  </div>

  <div id="thread-3" role="comment">
    Deleted ", however,"<br>&mdash;Magic Johnson
  </div>

  <div id="thread-4" role="comment">
    When you come to a fork in the road, take it.<br>&mdash;Yogi Berra
  </div>

  <div id="thread-5" role="comment">
    The atoms or elementary particles themselves are not real; they form a world of potentialities or possibilities rather than one of things or facts.<br>&mdash;Werner Heisenberg
  </div>

</div>
              
            
!

CSS

              
                body { display: flex; }
[role="mark"] { background-color: pink; }
.editor, .sidebar { border: 2px solid green; padding: 4px; }
.sidebar { border-left: 0; }
.commented-text { background-color: hsl(60, 100%, 85%); }
[role="doc-noteref"] { vertical-align: super; font-size: smaller; }
[role="doc-pagefooter"] { margin-top: 1em; font-style: italic;}
[role="doc-pageheader"] { margin-bottom: 1em; font-style: italic;}
ins { color: green; }
del { color: red; }
[role="comment"] { margin: 1em; border: 1px solid gray; padding: 5px;}
[aria-invalid] { text-decoration: underline dotted; }
[aria-invalid="spelling"] { text-decoration-color: red; }
[aria-invalid="grammar"] { text-decoration-color: blue; }
.colbreak { width: 2em; display: inline-block; }
.breakpoint { background-color: red; color: white; font-weight: bold;}

              
            
!

JS

              
                
              
            
!
999px

Console