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

              
                <div id="cbwrap">
  <!-- (X) TITLE -->
  <h1 id="cbtitle">Button Links</h1>
  
  <!-- (A) WRAP BUTTON IN ANCHOR TAG -->
  <a href="https://code-boxx.com">
    <button>Code Boxx</button>
  </a>
  
  <!-- (B) JS REDIRECT -->
  <button onclick="location='https://code-boxx.com'">
    Code Boxx
  </button>
  
  <!-- (C) SUBMIT FORM -->
  <form action="https://code-boxx.com" target="_blank">
    <input type="submit" value="Code Boxx">
  </form>
  
  <!-- (D) FORm ATION -->
  <form action="https://code-boxx.com">
    <input type="submit" value="Code Boxx">
    <input type="submit" value="Wikipedia" formaction="https://wikipedia.com">
    <input type="submit" value="Google" formaction="https://google.com/">
  </form>
  
  <!-- (E) LINK TO BUTTON -->
  <a class="linkbutton" href="https://code-boxx.com">
    Code Boxx
  </a>
  
  <!-- (X) INFO SNIPPET -->
  <div id="cbinfo">
    Visit <a href="https://code-boxx.com/html-button-links/" target="_blank">Code Boxx</a> for more details.
  </div>
</div>
              
            
!

CSS

              
                /* (E) LINK TO BUTTON */
.linkbutton {
  display: inline-block;
  padding: 10px; margin: 5px;
  color: #fff; background: #8a110b;
  text-decoration: none;
}

/* (X) DOES NOT MATTER */
body{background: url(https://images.unsplash.com/photo-1588337420510-22ed1ab56990?crop=entropy&cs=srgb&fm=jpg&ixid=M3wzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE3MDk1MjEwNzJ8&ixlib=rb-4.0.3&q=85)}
#cbwrap{background:rgba(255,255,255,.9);width:600px;padding:30px;border-radius:10px}
*{box-sizing:border-box;font-family:arial,sans-serif}
body{padding:0;margin:0;border:0;min-height:100vh;display:flex;justify-content:center;align-items:center;background-size:cover;background-position:center;backdrop-filter:blur(10px)}
#cbtitle{margin:0 0 30px;padding:0;text-transform:uppercase}
#cbinfo{margin-top:30px;padding-top:15px;border-top:1px solid #ddd;font-size:13px;font-weight:700}
#cbinfo a{text-decoration:none;padding:5px;color:#fff;background:#a91616}
              
            
!

JS

              
                
              
            
!
999px

Console