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

              
                <div id="app">
  <h2>Tabs</h2>
  <div class="tab">
    <ul class="tab__title">
      <li @click="activate(1)" :class="{'active' : isActive === 1}">🐸</li>
      <li @click="activate(2)" :class="{'active' : isActive === 2}">🌸</li>
      <li @click="activate(3)" :class="{'active' : isActive === 3}">🌕</li>
    </ul>
    <ul class="tab__content">
      <li v-if="isActive === 1">古池や蛙飛びこむ水の音</li>
      <li v-else-if="isActive === 2">散る桜残る桜も散る桜</li>
      <li v-else-if="isActive === 3">名月をとってくれろと泣く子かな</li>
    </ul>
  </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/vue"></script>

              
            
!

CSS

              
                *
  margin: 0
  padding: 0
  box-sizing: border-box

body
  background: #fafbfc
  padding: 10px
  color: #333
  h2
    margin-bottom: 1em

#app
  width: 100%
  max-width: 600px
  margin: 0 auto
  padding: 20px
  background: white
  box-shadow: 0 1px 3px rgba(0,0,0,.1)
  ul
    list-style: none
    &.tab
      &__title
        display: flex
        li
          text-align: center
          width: 30.333%
          margin: 0 1.5%
          padding: .5em
          border: 1px solid #eee
          border-radius: 30px
          &.active
            background: #eee
      &__content
        margin: 30px 0
        padding: 1em
        background: whitesmoke
        text-align: center
              
            
!

JS

              
                let vm = new Vue({
  el: '#app',
  data: {
    isActive: 1
  },
  methods: {
    activate(num){
      this.isActive = num;
    },
  }
})
              
            
!
999px

Console