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 mx-auto h-full flex flex-col justify-center items-stretch p-2 sm:p-8" x-data="{tab: 1}">
  <div class="ml-6 flex justify-start">
    <a class="block px-6 py-3 text-lg uppercase text-white rounded-tl-lg font-medium" :class="{'bg-black': tab === 1, 'bg-pink-800': tab !== 1}" href="#" @click.prevent="tab = 1">Tab 1</a>
    <a class="block px-6 py-3 text-lg uppercase text-white font-medium" :class="{'bg-black': tab === 2, 'bg-pink-800': tab !== 2}" href="#" @click.prevent="tab = 2" @click.prevent="tab = 2">Tab 2</a>
    <a class="block px-6 py-3 text-lg uppercase text-white rounded-tr-lg font-medium" :class="{'bg-black': tab === 3, 'bg-pink-800': tab !== 3}" href="#" @click.prevent="tab = 3" @click.prevent="tab = 3">Tab 3</a>

  </div>

  <div class="bg-gray-200 rounded-lg shadow-lg p-8" x-show="tab === 1">
    <h1 class="text-3xl leading-tight">Basic example of Alpine JS - Part 1</h1>
    <p class="text-base mt-4">Lorem ipsum dolor sit amet consectetur adipisicing elit. Possimus officia maiores ipsum illum enim repudiandae quaerat tenetur sunt dolore, voluptatem blanditiis quo doloremque commodi illo? Fugiat reiciendis aliquam omnis aperiam beatae? Officia, quas consequuntur numquam laboriosam dolorem totam est, vitae at nam iste autem inventore eveniet amet ex minima in asperiores debitis repudiandae eligendi. Sint esse dolorem est aperiam. Delectus!
    </p>
  </div>
  <div class="bg-green-200 rounded-lg shadow-lg p-8" x-show="tab === 2">
    <h1 class="text-3xl leading-tight">Basic example of Alpine JS - Part 2</h1>
    <p class="text-base mt-4">Lorem ipsum dolor sit amet consectetur adipisicing elit. Possimus officia maiores ipsum illum enim repudiandae quaerat tenetur sunt dolore, voluptatem blanditiis quo doloremque commodi illo? Fugiat reiciendis aliquam omnis aperiam beatae? Officia, quas consequuntur numquam laboriosam dolorem totam est, vitae at nam iste autem inventore eveniet amet ex minima in asperiores debitis repudiandae eligendi. Sint esse dolorem est aperiam. Delectus!</p>
  </div>
  <div class="bg-yellow-200 rounded-lg shadow-lg p-8" x-show="tab === 3">
    <h1 class="text-3xl leading-tight">Basic example of Alpine JS - Part 3</h1>
    <p class="text-base mt-4">Lorem ipsum dolor sit amet consectetur adipisicing elit. Possimus officia maiores ipsum illum enim repudiandae quaerat tenetur sunt dolore, voluptatem blanditiis quo doloremque commodi illo? Fugiat reiciendis aliquam omnis aperiam beatae? Officia, quas consequuntur numquam laboriosam dolorem totam est, vitae at nam iste autem inventore eveniet amet ex minima in asperiores debitis repudiandae eligendi. Sint esse dolorem est aperiam. Delectus!</p>
  </div>

</div>
              
            
!

CSS

              
                .font-sans {
  font-family: "Raleway", sans-serif;
}

html,
body {
  font-size: 13px;
}

@media only screen and (min-width: 640px) {
  html,
  body {
    font-size: 14px;
  }
}

@media only screen and (min-width: 768px) {
  html,
  body {
    font-size: 15px;
  }
}

@media only screen and (min-width: 1024px) {
  html,
  body {
    font-size: 16px;
  }
}

              
            
!

JS

              
                document.body.classList.add("min-h-screen");
document.body.classList.add("h-full");

              
            
!
999px

Console