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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <!-- Without Tailwind -->
<!-- <div class="card-container">
  <img class="card-image" src="https://cdn.vox-cdn.com/thumbor/ab7GeC585ehvC-Y4zEkqUcwOa9c=/0x0:2067x1377/1200x800/filters:focal(869x524:1199x854)/cdn.vox-cdn.com/uploads/chorus_image/image/54120135/your_name_oped.0.jpg" />
  <div class="card-content">
    <h3 class="card-title">Your Name</h1>
    <span class="card-text">Two teenagers share a profound, magical connection upon discovering they are swapping bodies. But things become even more complicated when the boy and girl decide to meet in person.</span>
    <button class="card-action">Watch Now</button>
  </div>
</div> -->

<!-- With Tailwind -->
<div class="card-container m-auto mt-8 bg-white rounded shadow-md overflow-hidden">
  <img class="w-full h-2/3 object-cover" src="https://cdn.vox-cdn.com/thumbor/ab7GeC585ehvC-Y4zEkqUcwOa9c=/0x0:2067x1377/1200x800/filters:focal(869x524:1199x854)/cdn.vox-cdn.com/uploads/chorus_image/image/54120135/your_name_oped.0.jpg" />
  <div class="flex flex-col items-start justify-center p-4">
    <h3 class="font-bold text-2xl mb-2">Your Name</h1>
    <span class="text-sm">Two teenagers share a profound, magical connection upon discovering they are swapping bodies. But things become even more complicated when the boy and girl decide to meet in person.</span>
    <button class="text-sm px-3 py-2 mt-3 rounded text-white bg-green-600">Watch Now</button>
  </div>
</div>
              
            
!

CSS

              
                html, body {
  background-color: #00214D;
}

/*
This is the only custom CSS required when using Tailwind.
.card-container {
  width: 400px;
  height: 480px;
}
*/

.card-container {
  width: 400px;
  height: 480px;
  margin: auto;
  margin-top: 2rem;
  background-color: #FFF;
  border-radius: 0.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 60%;
  object-fit: cover;
}

.card-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
}

.card-title {
  font-weight: bold;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.card-text {
  font-size: 0.8rem;
}

.card-action {
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  margin-top: 0.75rem;
  background-color: #38a169;
  border-radius: 0.25rem;
  color: #FFF;
}
              
            
!

JS

              
                
              
            
!
999px

Console