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

              
                utton<h1>Buttons & Links
<h2>Do I need a button or a link?</h2>

<table>
  <tr>
    <th scope="col">Scenario</th>
    <th scope="col">Button</th>
    <th scope="col">Link</th>
  </tr>
  <tr>
    <td>
      Executing a JS function or submitting a form
    </td>
    <td>
      Yes
    </td>
    <td>No</td>
  </tr>
   <tr>
    <td>
      Navigating to a new location
    </td>
    <td>
      No
    </td>
    <td>Yes</td>
  </tr>
</table>
  
  <h2>How to make links look like buttons, and vice versa</h2>
 <p>If your design has a button, but when you click it it goes to a new page, it should be a link with an <code>&lt;a&gt;</code> tag. Good news! With CSS, we can make it <em>look</em> like a button.</p>
  <button class="button">I'm a button!</button>
  <a class="button">I'm a link that looks like a button!</a>
  
  <p>If your design has a text link, but when you click it it executes a function, it should be a <code>&lt;button&gt;</code>. We can make it look like a text link with CSS</p>
  <a href="#">I'm a link!</a>
  
  <button class="link-as-button">I'm a button that looks like a link!</a>
              
            
!

CSS

              
                * {
  font-family: 'Helvetica Neue', sans-serif;
}

table {
  border: 1px solid #8d6c99;
}

th, td {
  border: 1px solid #8d6c99;
  padding: 0.5rem;
}

.button {
  line-height: 1rem;
  cursor: pointer;
  border: 0;
  display: inline-block;
  font-size: 1rem;
  border-radius: 6px;
  background-color: #420a55;
  color: white;
  font-weight: bold;
  padding: 0.8rem 1rem;
}

.button:hover {
    background-color: #8d6c99;
}

a.button:hover {
  text-decoration: none;
}

a {
  font-weight: bold;
  color: #420a55;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.link-as-button {
  color: #420a55;
  display: inline;
  cursor: pointer;
  background: none;
  border: 0;
  font-size: 1rem;
  font-weight: bold;
}
.link-as-button:hover {
  text-decoration: underline;
}
              
            
!

JS

              
                
              
            
!
999px

Console