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 p-6 text-center">
  <h1 class="text-4xl">Alpine & Tailwind</h1>
  <div class="flex justify-center">
    <img class="h-24 mt-4" src="https://cdn0.iconfinder.com/data/icons/travel-filled-line-4/64/Travel-Filled-12-512.png" />
    <img class="h-32" src="https://www.drupal.org/files/project-images/screenshot_361.png" />
  </div>
  <p>This example demonstrate how to use <a class="font-bold underline" target="_blank" href="https://github.com/alpinejs/alpine/">Alpine.js</a> and <a target="_blank" class="font-bold underline" href="https://tailwindcss.com">Tailwind.css</a></p>
  <p class="mt-4">Lorem ipsum dolor sit amet consectetur adipisicing elit. Rerum, pariatur eaque porro id delectus provident exercitationem sed sint labore? Quae laudantium consequatur nihil doloribus suscipit, voluptatum omnis dolorum ullam deleniti.</p>

  <div class="mt-6" x-data="{ open: false }">
    <button class="bg-blue-500 text-white px-4 py-2 rounded no-outline focus:shadow-outline select-none" @click="open = true">Open Dropdown</button>

    <div class="absolute top-0 left-0 w-full h-full flex items-center justify-center" style="background-color: rgba(0,0,0,.5);" x-show="open">
      <div class="text-left bg-white h-auto p-4 md:max-w-xl md:p-6 lg:p-8 shadow-xl rounded mx-2 md:mx-0" @click.away="open = false">
        <h2 class="text-2xl">Modal title</h2>
        <ul class="list-decimal m-4">
          <li>Consectetur adipisicing elit. Neque nemo earum eaque vel aperiam cupiditate</li>
          <li>Neque nemo earum eaque vel aperiam cupiditate. Quae quam dolorum eaque</li>
          <li>Vel aperiam cupiditate. Quae quam dolorum eaque</li>
          <li>Nemo earum eaque vel aperiam cupiditate. Quae quam dolorum eaque</li>
          <li>Eaque cupiditate eos illo debitis quod neque deserunt itaque velit, earum doloribus</li>
        </ul>
        <div class="flex justify-center mt-8">
          <button class="bg-gray-700 text-white px-4 py-2 rounded no-outline focus:shadow-outline select-none" @click="open = false">Close</button>
        </div>
      </div>
    </div>
    
    <small class="absolute bottom-0 w-full right-0 p-4">
      <a class="underline" href="https://www.iconfinder.com/icons/3671988/filled_high_landscape_mountain_nature_peak_travel_icon">Mountains icon credit</a>
      &
      <a class="underline" href="https://www.drupal.org/project/tailwindcss">Tailwind icon credit</a>
    </small>
  </div>
</div>
              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console