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="container">
  <button class="button primary" type="button">1️⃣我是button元素(未设置tabindex)💯</button>
    <div class="button primary" role="button">2️⃣我是div元素(未设置tabindex)♨️</div>
    <button class="button success" type="button" tabindex="-1">3️⃣我是button元素(tabindex="-1")💯</button>
    <div class="button success" role="button" tabindex="-1">4️⃣我是div元素(tabindex="-1")♨️</div>
    <button class="button danger" type="button" tabindex="0">5️⃣我是button元素(tabindex="0")💯</button>
    <div class="button danger" role="button" tabindex="0">6️⃣我是div元素(tabindex="0")♨️</div>
    <button class="button warning" type="button" tabindex="">7️⃣我是button元素(tabindex="")💯</button>
    <div class="button warning" role="button" tabindex="">8️⃣我是div元素(tabindex="")♨️</div>
</div>
              
            
!

CSS

              
                
@import 'https://fonts.googleapis.com/css?family=Share+Tech+Mono';

@import 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css';

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
    width: 100vw;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1376484/jess-harding-lqT6NAmTaiY-unsplash.jpg'),radial-gradient(#28a3dd, #0d7751);
    background-size: cover;
    background-position: center;
    font-family: "Share Tech Mono", monospace;
    font-size: 2rem;
    background-blend-mode: multiply,screen, overlay;
}

.container {
    position: relative;
    background-size: cover;
    background-position: center;
    backdrop-filter: blur(20px);
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 5px;
    padding:2vw;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    transition: .3s ease;
    margin: 3vw;
    min-width: 80vw;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(30vw, 1fr));
    grid-gap: 10px;
}

.button {
	display: inline-flex;
	font-size: 16px;
	font-weight: 700;
	border-radius: 5px;
	transition: background .3s;
  padding: 4vh 6vh;
  background: #11a8ab;
  border: none 0;
  color: #fff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  
  &.primary {
    background: #007bff;
    
    &:hover {
      background: #0069d9;
    }
  }
  
  &.success{
    background: #28a745;
    
    &:hover {
      background: #218838;
    }
  }
  
  &.danger {
    background: #dc3545;
    
    &:hover {
      background: #c82333;
    }
  }
  
  &.warning {
    background: #17a2b8;
    
    &:hover {
      background: #138496;
    }
  }
}


.button:focus,
.button:active {
    box-shadow: inset 0 0 3px  3px #0a166f;
} 

              
            
!

JS

              
                
              
            
!
999px

Console