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 class="buttons">
        <a href="#" class="moody">Moody Button</a>
        <a href="#" class="dashing">😎 Dashing Button</a>
        <button class="crispy">Crispy Button</button>
      </div>
<div class="buttons">
        <a href="#" class="moody-fill">Moody Button</a>
        <a href="#" class="dashing-fill">😎 Dashing Button</a>
        <button class="crispy-fill">Crispy Button</button>
      </div>

<!-- Credit -->
<a class="credit" href="https://www.iamsajid.com/">Sajid</a>
              
            
!

CSS

              
                /* Colors & fonts variables */
/* You just have to look at the Actual code */

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap");
:root{
  --ff: "Montserrat", sans-serif;
  --colorp: #f9f9f9;
  --colorp2: #fff;
  --colora: #ffe537;
  --colora2: #537fe7;
  --colorbody: #1e1e1e;
  --colors: #333;
  --h1: bold 54px/60px var(--ff);
  --h2: bold 36px/48px var(--ff);
  --h3: bold 24px/36px var(--ff);
  --links: 18px/18px var(--ff);
  --p: 18px/30px var(--ff);
  --p1: 24px/30px var(--ff);
  --p2: 36px/48px var(--ff);
  --subtext: 12px/20px var(--ff);
  --transition: 0.3s ease-in-out;
}
body {
  width: 90%;
  margin: 20px auto;
  max-width: 1080px;
  background-color: var(--colorbody);
  color: var(--colorp);
}

/* Actual code */
.buttons {
  display: flex;
  margin: 100px auto;
  justify-content: space-between;
  gap: 40px;
  align-items: center;
  flex-wrap: wrap;
}

/* Repeating code */
.buttons > *{
  cursor: pointer;
  background: var(--colorbody);
  text-decoration: none;
  font: var(--links);
  padding: 12px 20px;
  border-radius: 8px;
  color: var(--colora);
  transition: var(--transition);
  }
.buttons > *:hover{
  transition: var(--transition);
  }

/* moody */
.moody{
  box-shadow: 0 0 16px var(--colora);
}
.moody:hover {
  box-shadow: 0 0 24px var(--colora);
}
.moody-fill{
  box-shadow: 0 0 16px var(--colora);
  background: var(--colora);
  color: var(--colorbody);
}
.moody-fill:hover {
  box-shadow: 0 0 24px var(--colora);
}

/* dashing */
.dashing{
  background: linear-gradient(var(--colorbody), var(--colorbody)) padding-box,
    linear-gradient(45deg, var(--colora) 0%, var(--colora2) 100%) border-box;
  border: solid 2px transparent;
}
.dashing:hover {
  border: solid 2px var(--colorp);
}

.dashing-fill{
  color: var(--colorbody);
  background: linear-gradient(
    270deg,
    var(--colora),
    var(--colora2),
    var(--colora),
    var(--colora2)
  );
  background-size: 300% 300%;
  animation: bg 10s ease-in-out infinite;
}@keyframes bg {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 100%;
  }
  100% {
    background-position: 0% 50%;
  }
}
.dashing-fill:hover {
  animation: bg 2s ease-in-out infinite;
}

/* crispy */
.crispy{
   border: solid 1px var(--colora);
   box-shadow: 0 2px var(--colora);
}
.crispy:hover {
  box-shadow: 0 4px var(--colora);
}
.crispy-fill{
  background: var(--colora2);
  color: var(--colorp);
  border: solid 1px var(--colorp);
  box-shadow: 0 2px var(--colorp);
}
.crispy-fill:hover {
  box-shadow: 0 4px var(--colorp);
}


















/* Credit */
.credit {
  text-decoration: none;
  position: fixed;
  bottom: 20px;
  right: 5vw;
  background: var(--colors);
  padding: 4px 20px;
  border-radius: 4px;
  font: var(--p);
  color: var(--colorp);
}

.credit:hover {
  color: var(--colora);
  transition: var(--transition);
}
              
            
!

JS

              
                
              
            
!
999px

Console