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 class="examples">
        <h1>Site title</h1>
        <nav>
          <ul>
            <li class="active">List 1 </li>
            <li class="no-active nofollow">List 2 </li>
            <li>List 3 </li>
            <li id="item" class="fourth-item">List 4 </li>
            <li>List 5 </li>
          </ul>
        </nav>
        <section> 
          <h1>Header 1</h1>
          <h2>Header 2</h2>
          <h3>Header 3</h3>
          <h4>Header 4</h4>
          <h5>Header 5</h5>
          <h6>Header 6</h6>
        </section>
        <section>
          <h1>Links</h1>
          <a href="test.html">Sample text link</a>
          <a href="#">Sample button link</a>
        </section>
        <section>
          <h1>Lists</h1>
          <ul>
            <li>List Item 1</li>
            <li>List Item 2</li>
            <li>List Item 3</li>
            <li>List Item 4</li>
            <li>List Item 5</li>
            <li>List Item 6</li>
          </ul>
          <ul>
            <li>List Item 1</li>
            <li>List Item 2</li>
            <li>List Item 3</li>
            <li>List Item 4</li>
            <li>List Item 5</li>
            <li>List Item 6</li>
          </ul>
          <ol>
            <li>First</li>
            <li>Second</li>
            <li>Third</li>
            <li>Fourth</li>
            <li>Fifth</li>
            <li>Sixth</li>
          </ol>
          <dl>
            <dt> Kick </dt>
            <dd> 808 </dd>
            <dt> Snare </dt>
            <dd> 909 </dd>
          </dl>
          <dl>
            <dt> Maine </dt>
            <dd> Augusta </dd>
            <dt> California </dt>
            <dd> Sacremento </dd>
            <dt> Oregon </dt>
            <dd> Salem </dd>
            <dt> New York </dt>
            <dd> Albany </dd>
          </dl>
        </section>

        <section>
          <h1>Forms</h1>
          <form>
            <fieldset>
              <!--
              Every fieldset must contain a legend. IE barfs if it's not there.
              It's no fun.
              -->
              <legend>Legend Example</legend>

              <div>
                <label>Text Input Label</label>
                <input type="text">
                <p>Helper text if necessary.</p>
              </div>
              <div>
                <label>Password</label>
                <input type="password">
                <p>Error messages when appropriate.</p>
              </div>

              <div>
                <label for="first-name">First Name</label>
                <input type="text" id="first-name">
              </div>

              <div>
                <label for="last-name">Last Name</label>
                <input type="text" id="last-name">
              </div>

              <div>
                <label for="email">Email</label>
                <input type="email" id="email">
              </div>

              <div>
                <label for="gender">Dropdown</label>
                <select>
                  <option>Option 1</option>
                  <option>Option 2</option>
                  <option>Option 3</option>
                </select>
              </div>
              <div>
                <label>Radio Buttons</label>
                <ul>
                  <li><label><input type="radio"> Label 1</label></li>
                  <li><label><input type="radio"> Label 2</label></li>
                  <li><label><input type="radio"> Label 3</label></li>
                </ul>
              </div>
              <div>
                <label for="url">URL Input</label>
                <input type="url" placeholder="http://bullgit.cc">
              </div> 
              <div> 
                <label>Text area</label>
                <textarea></textarea>
              </div>
              <div>
                <label><input type="checkbox"> This is a checkbox.</label>
              </div>
              <div>
                <input type="submit" value="Submit">
              </div>
            </fieldset>
          </form>
        </section>
        <section>
          <h1>Buttons</h1>
          <button>A button</button>
          <button>A button</button>
          <button>A large button</button>
        </section>
        <hr>
        <section>
          <h1>An Example Article</h1>
          <article>
            <h1>Title</h1>
            <p>
              Lorem ipsum dolor sit amet, <b>consectetur adipisicing elit</b>, sed do eiusmod
              tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
              quis nostrud <em>exercitation ullamco laboris nisi ut aliquip ex ea commodo
                consequat</em>. Duis aute irure dolor in reprehenderit in voluptate velit esse
              cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
              non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
            </p>
            <blockquote>
              <p>
                This is a GREAT pull quote.
              </p>
              <a href="#">- Author</a>
            </blockquote>
            <p>
              Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet,
              consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt
              ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima
              veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi
              ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit
              qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum
              qui dolorem eum fugiat quo voluptas nulla pariatur?"
            </p>
            <p>
              At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis
              praesentium voluptatum deleniti atque corrupti quos dolores et quas
              molestias excepturi sint occaecati cupiditate non provident, similique sunt
              in culpa qui officia deserunt mollitia animi, id est laborum et dolorum
              fuga. Et harum quidem rerum facilis est et expedita distinctio.
            </p>
          </article>
        </section>
        <hr>

        <section>
          <h1>Code examples</h1>
          <code>
            <pre>      sudo ipfw pipe 1 config bw 256KByte/s
      sudo ipfw add 1 pipe 1 src-port 3000
    </pre>
        </code>
      </section>
      <hr>
      <section>
        <h1>Footer</h1>
        <footer>
          <p>Copyright 2013. Made with love by <a href="http://mrmrs.cc" title="MRMRS - Designer">mrmrs</a>.</p>
          <ul>
            <li>
              <a href="#">Home</a>
            </li>
            <li>
              <a href="#">Contact</a>
            </li>
            <li>
              <a href="#">Jobs</a>
            </li>
          </ul>
          <ul>
            <li>
              <a href="https://twitter.com" title=" on Twitter">Twitter</a>
            </li>
            <li>
              <a href="https://pinterest.com" title=" on Pinterest">Pinterest</a>
            </li>
            <li>
              <a href="http://instagram.com" title=" on Instagram">Instagram</a>
            </li>
            <li>
              <a href="http://dribbbble.com" title=" on Dribbble">Dribbble</a>
            </li>
            <li>
              <a href="https://github.com" title=" on Github">Github</a>
            </li>
          </ul>
        </footer>
      </section>

      <section>
        <h1 class="other-class">New hawtness</h1>
        <progress value="80" max="100">80 %</progress>
        <p class="test-class">We are this close to the goal: <meter min="0" max="1000" value="824">$824</meter>.</p>
      </section>

      <section>
        <header>
          <h1 class="other-class">Random Stuff</h1>
        </header>
        <small>This is for things like copyright info</small>
        <s>Content that isn't accurate or relevant anymore.</s>
        <span>Generic span wrapper</span>
        <abbr>HTML How to meet ladies</abbr>
        <p class="test-class">This is inline text with <sub>subscript</sub> and <sup>superscript</sup> elements.</p>
        <p class="test-class">
          <var>f</var>(<var>x</var>) = <var>a</var><sub>0</sub> + <var>a</var><sub>1</sub><var>x</var> +
          <var>a</var><sub>2</sub><var>x</var><sup>2</sup>, where <var>a</var><sup>2</sup> ≠ 0
        </p>
        <time datetime="2013-09-07" pubdate="">07 September 2013</time>
      </section>

      <section>
        <figure>
          <img src="/img/figure-example.jpg" alt="Figure Example">
          <figcaption>
            Photo of the sky at night. Original by <a href="http://flickr.com/photos/heyitsadam/">@mrmrs</a>
          </figcaption>
        </figure>
      </section>

      <section>
        <!--
        http://www.w3.org/html/wg/drafts/html/master/text-level-semantics.html#the-samp-element
        -->
        <samp>
          <pre>          /Sites/html master  ☠ ☢
          $  <kbd>ls -gto</kbd>

          total 104
          -rw-r--r--   1   10779 Jun  5 16:24 index.html
          -rw-r--r--   1    1255 Jun  5 16:00 _config.yml
          drwxr-xr-x  11     374 Jun  5 15:57 _site
          -rw-r--r--   1    1597 Jun  5 14:16 README.md
          drwxr-xr-x   5     170 Jun  5 14:15 _sass
          -rw-r--r--   1     564 Jun  4 15:59 Rakefile
          drwxr-xr-x   6     204 Jun  4 15:59 _includes
          drwxr-xr-x   4     136 Jun  4 15:59 _layouts
          drwxr-xr-x   3     102 Jun  4 15:59 _resources
          drwxr-xr-x   3     102 Jun  4 15:59 css
          -rw-r--r--   1    1977 Jun  4 15:59 favicon.icns
          -rw-r--r--   1    6518 Jun  4 15:59 favicon.ico
          -rw-r--r--   1    1250 Jun  4 15:59 touch-icon-ipad-precomposed.png
          -rw-r--r--   1    2203 Jun  4 15:59 touch-icon-ipad-retina-precomposed.png
          -rw-r--r--   1    1046 Jun  4 15:59 touch-icon-iphone-precomposed.png
          -rw-r--r--   1    1779 Jun  4 15:59 touch-icon-iphone-retina-precomposed.png
        </pre>
      </samp>
    </section>
    <section>
      <h1 class="other-class">Tables</h1>
       Table footer info <table>
        <caption>Tabular Data ExampleTabular Data Examples</caption>
        <thead>
          <tr>
            <th>ID</th>
            <th>Name</th>
            <th>Date</th>
            <th>Address</th>
          </tr>
        </thead>
        <tfoot></tfoot>
        <tbody>
          <tr>
            <td>#999-32ac</td>
            <td>First Name</td>
            <td>13 May, 2013</td>
            <td>999 Spruce Lane, Somewhere, CA 94101</td>
          </tr>
          <tr>
            <td>#888-32dd</td>
            <td>Sample Name</td>
            <td>17 May, 1984</td>
            <td>999 Spruce Lane, Somewhere, CA 94101</td>
          </tr>
        </tbody>
      </table>
    </section>
    <section>
      <h1>Floats</h1>
      <div>
        <img src="http://placekitten.com/200/150" style="float:left;">
        <p>
          This is an image that has been floated to the left of this paragraph.
          The parent element that contains the image and paragraph does not have a clearfix applied to it.
          As you can see. All these lines tell us a few things. What they tell us, well, that is a story
          for another time.
        </p>
      </div>
    </section>
    <section>
      <h1>Common inline-block problems</h1>
      <div>
        <h2>Four elements set to inline-block and width: 25%</h2>
        <p>Notice how the whitespace between the elements gets rendered, this is why the fourth element breaks to a separate line.</p>
        <div style="width:25%; display: inline-block;margin: 0;">
          Div 1
        </div>
        <div style="width:25%; display: inline-block;margin: 0;">
          Div 2
        </div>
        <div style="width:25%; display: inline-block;margin: 0;">
          Div 3
        </div>
        <div style="width:25%; display: inline-block;margin:0; ">
          Div 4
        </div>
      </div>
    </section>
    <section>
      <footer>
        <small>© 2014 Some company name</small>
        <address> hi@email.co </address>
      </footer>
    </section>
  </div>
              
            
!

CSS

              
                @import "bourbon";

@mixin alert-clicked(){
  opacity: 1;
  content:'clicked!';
  background: rgba(yellow, .8);
  color: #000;
}
// Demo purpose only 
body{
  padding: 1em;
}
ul li{
  margin: 15px 0;
  padding: 15px 0;
}


// Debug

[debug]{
  border: 2px red dashed;
  &:before,&:after{
    font-family: "courier new", sans-serif;
    font-size: .9rem;
    font-weight: 300  ;
    content:'Debug level: 1';
    padding: .5em;
    background: rgba(#00FF87, .8);
    color: #000; 
    max-height: 30px;
    margin-top: -30px;
    display: block;
    position: absolute;
    z-index: 99999;
    opacity: .1;
  }

  &:hover{
    &:before,&:after{
      opacity: 1;
    }
  }

  [id]{
    &:after{
      content: 'id: .'attr(id);
      margin-left: 20%;
    }
  }
  [class]{
    &:after{
      content: 'class: .'attr(class);
      margin-left: 40%;
    }
  }
  [href]{
    &:after{
      content: 'href: .'attr(href);
      margin-left: 40%;
    }
  }
  [id][class]{
    &:after{
      content: 'class: .'attr(class)'; id: #'attr(id);
      margin-left: 40%;
    }
  }
  &:not([class]){
    &:after{
      content: '';
    }
  }


  &> [debug]{
    border: 2px green dashed;
    &:before{
      content:'Debug level: 2';}
    &:before,&:after{
      background: rgba(#00CB6B, .8);
    }
    &> [debug]{
      border: 2px blue dashed;
      &:before{
        content:'Debug level: 3';}
      &:before,&:after{
        background: rgba(#00974F, .8);
      }
      &> [debug]{
        border: 2px purple dashed;
        &:before{
          content:'Debug level: 4';}
        &:before,&:after{
          background: rgba(#006333, .8);
          color: #fff;

        }
        &> [debug]{
          border: 2px orange dashed;
          &:before{
            content:'Debug level: 5';}
          &:before,&:after{
            background: rgba(#970000, .8);
          }
          &> [debug]{
            border: 2px dodgerblue dashed;
            &:before{
              content:'Debug level: 6';}
            &:before,&:after{
              background: rgba(#CB0000, .8);
            }
            &> [debug]{
              border: 2px rebeccapurple dashed;
              &:before{
                content:'Debug level: 7, well how about stop nesting elements ?';}
              &:before,&:after{
                background: rgba(#FF0000, .8);
              }
            } 
          }
        }
      } 
    }
  }
}

[debug]:active:before,[debug]:active:after,
[debug]>[debug]:active:before,[debug]>[debug]:active:after,
[debug]>[debug]>[debug]:active:before,[debug]>[debug]>[debug]:active:after,
[debug]>[debug]>[debug]>[debug]:active:before,[debug]>[debug]>[debug]>[debug]:active:after,
[debug]>[debug]>[debug]>[debug]>[debug]:active:before,[debug]>[debug]>[debug]>[debug]>[debug]:active:after,
[debug]>[debug]>[debug]>[debug]>[debug]>[debug]:active:before,[debug]>[debug]>[debug]>[debug]>[debug]>[debug]:active:after,
[debug]>[debug]>[debug]>[debug]>[debug]>[debug]>[debug]:active:before,[debug]>[debug]>[debug]>[debug]>[debug]>[debug]>[debug]:active:after{
  @include alert-clicked()
    } 
              
            
!

JS

              
                $(function(){
  var all = $('*');
  all.each(function(){
    $(this).attr('debug','');
  })
})
              
            
!
999px

Console