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

              
                <!--
Still working out how to organize this. SHould I put the other top level items under No?...
-->

<article>
  <!-- this adapatation's code is probably not correct at all :P -->
  <h5><!-- <-- hee hee. get it? -->
    <a href='//html5doctor.com/downloads/h5d-sectioning-flowchart.png'>Originally</a> by <a href='//twitter.com/riddle'>@riddle</a> & <a href='//twitter.com/boblet'>@boblet</a>
  </h5>
  <p><a href='//html5doctor.com'>HTML5 Doctor</a></p>
  <section id='flowchart' class="ladder tree">
  <h1>
    HTML5 Element Flowchart
  </h1>
  <ul>
    <li><a href='#'>Is it a major navigation block?</a>
      <ul>
        <li>
          <a href='//html5doctor.com/nav'>
            <p>Yes:</p>
            <pre>nav*</pre>
            <p>
              Site or in-page navigation (anything you'd use a "skip to nav" link for)
            </p>
          </a>          
        </li>
      </ul>
    </li>
    <li><a href='#'>Does it make sense on it's own? e.g. in a feed reader</a>
      <ul>
        <li>
          <a href='//html5doctor.com/article'>
            <p>Yes:</p>
            <pre>article*</pre>
            <p>
              News article, weblog or forum post, comment on an article, sidebar widget etc, with a heading...)
            </p>
          </a>          
        </li>
      </ul>
    </li>
    <li><a href='#'>It is required to understand the current content?</a>
      <ul>
        <li>
          <a href='//html5doctor.com/aside'>
            <p>No:</p>
            <pre>aside*</pre>
            <p>
              Sidebar, comments section, pullquote, glossary, advertising, footnote etc, that's tangentially related to the page or content...
            </p>
          </a>          
        </li>
      </ul>
    </li>
    <li><a href='#'>Could you move it to an appendix?</a>
      <ul>
        <li>
          <a href='//html5doctor.com/figure'>
            <p>Yes:</p>
            <pre>figure</pre>
            <p>
              One or more images, graphics, code samples etc, plus optional &lt;figcaption&gt;
            </p>
          </a>          
        </li>
      </ul>
    </li>
    <li><a href='#'>Is it logical to add a heading?</a>
      <ul>
        <li>
          <a href='//html5doctor.com/section'>
            <p>Yes:</p>
            <pre>section*</pre>
            <p>
              A section of the page, or chapter of an article, with a heading...
            </p>
          </a>          
        </li>
      </ul>
    </li>
    <li><a href='#'>Does it have <strong>any</strong> semantics?</a>
      <ul>
        <li>
          <a href='//html5doctor.com/semantics'>
            <p>Yes:</p>
            <pre>Appropriate element</pre>
            <p>
              Probably p but possible blockquote, pre...
            </p>
          </a>          
        </li>
        <li>
          <a href='//html5doctor.com/div'>
            <p>No:</p>
            <pre>div</pre>
            <p>
              Flow content with no additional semantics, e.g. for CSS hooks...
            </p>
          </a>          
        </li>
      </ul>
    </li>
  </ul>
  </section>
  <section>
    <h6>*Sectioning content element:</h6>
    <p>
      These four elements (and their headings) are used by <a href='//html5doctor.com/outline'>HTML5's outlining algorithm.</a> to make the document's outline
    </p>
  </section>
  <footer>
    <p>
      2011-07-22 v1.5<br />
      <a href='//html5doctor.com/sematics'>For more information: semantics</a>  
    </p>
    <label><input type='checkbox' id='closeother' checked /> Open only one panel</label>
  </footer>
</article>

              
            
!

CSS

              
                @import "compass/css3";

// imported sheet from https://codepen.io/geoffyuen/pen/hzJvd
@import 'https://fonts.googleapis.com/css?family=Montserrat:300,400,700';


html {
  //background: $dkgray;
  -webkit-font-smoothing: antialiased;
}

body {
  max-width: 80%;
  padding: 2em 0;
  color: $blue;
  font-family: Montserrat, sans-serif;
}
h1,h2,h3,h4,h5,h6 {
  color: $blue;
}
a {
  &:link {
    color: $dkblue;
  }
  &:visited {
    color: $dkblue;
  }
  &:hover {
    color: $dkyellow;
  }
}
// style

.ladder {
  margin: 1em 0;
  ul {
    font-weight: bold;
    color: $yellow;
    margin: 0;
    line-height: 1.1;
    ul {
      li {
        display: block;
        padding: 0;
       }
     }
  }
  li {
    list-style-type: none;
    padding: 0;
  }
  a {
    text-decoration: none;
    padding: .5em 1em;
    display: block;
    background: $dkblue;
    border-top: 1px solid #fff;
    &:link, &:visited {
        color: #fff;
      }
    &:hover {
      background: $blue;
      color: $yellow;
    }
    pre {
      color: $yellow;
      margin: .5em 0 .75em;
    }
  }
}

// page layout

section {
  padding: 0 2em 0 0;
  vertical-align: top;
}

footer {
  margin: 2em 0 0;
  font-size: .8em;
}
              
            
!

JS

              
                (function(){
  $hook = $("#flowchart li ul");
  $hook.slideToggle(0); // hide all nested lists
  $hook.prev("a").click(function(){ // add fn to list items that have a nested list
    if ($('#closeother').is(':checked')) { // check if user wants one panel open at a time
       $hook.slideUp(100); // close all those bitches
    }
    $(this).next("ul").slideToggle(100); // show/hide the nested list
    return false; // prevent scrolling
  });
})();
              
            
!
999px

Console