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

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

              
                <header class="c-header">
 <h1 class="c-header_title">BazingaNet</h1>
 <nav class="c-header_nav">
  <ul class="c-header_menu">
   <li>
    <a href="#">Link</a>
   </li>
   <li>
    <a href="#">Link</a>
   </li>
   <li>
    <a href="#">Link</a>
   </li>
   <li>
    <a href="#">Link</a>
   </li>
   <li class="cta">
    <a href="#">Sign Up</a>
   </li>
   <li class="cta">
    <a href="#">Buy Now</a>
   </li>
  </ul>
 </nav>
</header>
<main>
 <div class="l-container">
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Et alias iste voluptatum sequi tempora commodi inventore, possimus itaque illo incidunt nemo nihil. Perspiciatis obcaecati animi voluptate, magni tempora eius reiciendis.</p>
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Et alias iste voluptatum sequi tempora commodi inventore, possimus itaque illo incidunt nemo nihil. Perspiciatis obcaecati animi voluptate, magni tempora eius reiciendis.</p>
 </div>
</main>
              
            
!

CSS

              
                *,
*::before,
*::after {
 box-sizing: border-box;
}

.c-header {
 align-items: center;
 background: rebeccapurple;
 color: #fefefe;
 display: flex;
 margin-bottom: 2rem;
 padding: 1.5rem;
}

.c-header_title {
 margin: 0;
 padding-right: 1rem;
}

.l-container {
 margin-left: auto;
 margin-right: auto;
 max-width: 1024px;
}

.c-header_menu a {
 display: block;
 color: #fefefe;
 padding: 0.7rem 1rem;
 text-decoration: none;
}

/* Ensure the nav element takes up the remaining space */
.c-header_nav {
 flex-grow: 1;
}

/* Set the Menu to be a flex container */
.c-header_menu {
 display: flex;
 list-style: none;
 padding-left: 1rem;
 padding-right: 1rem;
}

/* Target any list item with the class .cta
that follows an li that does NOT have the .cta class 
*/
.c-header_menu li:not(.cta) + .cta {
 margin-left: auto;
}

/* Add extra space between the .cta menu items since they have a background and border */
.c-header_menu .cta {
 margin-right: 1rem;
}

/* Remove the extra margin if this menu item is the last one */
.c-header_menu .cta:last-child {
 margin-right: 0;
}

.c-header_menu .cta a {
 border: 1px solid;
 background: #fefefe;
 color: rebeccapurple;
 font-weight: bold;
}

              
            
!

JS

              
                
              
            
!
999px

Console