Pen Settings



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


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


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.


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.


<h1>Horizontal Nav Sample</h1>

<nav class="nav-horizontal">
  <div class="mask">
    <ul class="list">
      <li><a href="#">Alpha</a></li>
      <li><a href="#">Beta</a></li>
      <li><a href="#">Gamma</a></li>
      <li><a href="#">Delta</a></li>
      <li><a href="#">Epsilon</a></li>
      <li><a href="#">Zeta</a></li>
      <li><a href="#">Eta</a></li>
      <li><a href="#">Theta</a></li>
      <li><a href="#">Iota</a></li>
      <li><a href="#">Kappa</a></li>
      <li><a href="#">Lambda</a></li>
      <li><a href="#">Mu</a></li>
      <li><a href="#">Nu</a></li>
      <li><a href="#">Xi</a></li>

<p>Lorem ipsum dolor sit amet, probo senserit molestiae ut quo, odio vide ipsum per id. Quo eius ignota id, an usu dolorem ancillae, ius autem ponderum ut. In doctus fuisset persecuti eam, assueverit sadipscing pro ut. In malis moderatius duo.</p>



                h1, p {
  margin: 20px;
  color: #666;
  line-height: 1.75em;

.nav-horizontal {
  background-color: #fff;
  overflow: hidden;
  height: 3em;
  width: 100%;
  .mask {
    height: 5em;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  .list {
    display: inline-table;
    margin: 0 auto;
    max-width: 100%;
    li {
    display: table-cell;

    a {
      display: block;
      padding: 0 1em;
      text-decoration: none;
      color: #333;
      height: 3em;
      line-height: 3;
      &:hover {
        border-bottom: 2px solid black;
        background-color: #f9f9f9;

//codepen用 reset
*{box-sizing: border-box;}body{font-family:sans-serif;padding-top: 100px;width:100vw;background-color:#999;}