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="layout">
  <main>
		<article class="inline-flex w-full flex-col lg:w-auto | card">
	    <a href="#" class="card__wrap">
		    <div class="group relative">
			    <div class="aspect-h-1 aspect-w-1 overflow-hidden rounded-md bg-gray-200 | card__media">
				    <img
                 src="https://tailwindui.com/img/ecommerce-images/home-page-02-product-01.jpg"
                 alt="Black machined steel pen with hexagonal grip and small white logo at top."
                 class="h-full w-full object-cover object-center group-hover:opacity-75"
                 />
			    </div>
		    </div>
		    <div class="card__content">
			    <div class="card_description">
				    <p class="text-sm text-gray-500">Black</p>
				    <h3 class="mt-1 font-semibold text-gray-900">Machined Pen</h3>
				    <p class="mt-1 text-gray-400">
					    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Beatae corporis cupiditate
					    doloremque ea eum exercitationem explicabo facilis fugiat!
				    </p>
				    <p class="mt-1 text-gray-900">$35</p>
			    </div>
			    <h4 class="sr-only">Available colors</h4>
			    <ul role="list" class="mt-auto space-x-3 pt-6 | card__options">
				    <li class="h-4 w-4 rounded-full border border-black border-opacity-10" style="background-color: #111827">
					    <span class="sr-only">Black</span>
				    </li>
				    <li class="h-4 w-4 rounded-full border border-black border-opacity-10" style="background-color: #fde68a">
					    <span class="sr-only">Brass</span>
				    </li>
				    <li class="h-4 w-4 rounded-full border border-black border-opacity-10" style="background-color: #e5e7eb">
					    <span class="sr-only">Chrome</span>
            </li>
          </ul>
        </div>
      </a>
    </article>
    <article class="inline-flex w-full flex-col lg:w-auto | card">
	    <a href="#" class="card__wrap">
		    <div class="group relative">
			    <div class="aspect-h-1 aspect-w-1 overflow-hidden rounded-md bg-gray-200 | card__media">
				    <img
                 src="https://tailwindui.com/img/ecommerce-images/home-page-02-product-01.jpg"
                 alt="Black machined steel pen with hexagonal grip and small white logo at top."
                 class="h-full w-full object-cover object-center group-hover:opacity-75"
                 />
			    </div>
		    </div>
		    <div class="card__content">
			    <div class="card_description">
				    <p class="text-sm text-gray-500">Black</p>
				    <h3 class="mt-1 font-semibold text-gray-900">Machined Pen</h3>
				    <p class="mt-1 text-gray-400">
					    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Beatae corporis cupiditate
					    doloremque ea eum exercitationem explicabo facilis fugiat!
				    </p>
				    <p class="mt-1 text-gray-900">$35</p>
			    </div>
			    <h4 class="sr-only">Available colors</h4>
			    <ul role="list" class="mt-auto space-x-3 pt-6 | card__options">
				    <li class="h-4 w-4 rounded-full border border-black border-opacity-10" style="background-color: #111827">
					    <span class="sr-only">Black</span>
				    </li>
				    <li class="h-4 w-4 rounded-full border border-black border-opacity-10" style="background-color: #fde68a">
					    <span class="sr-only">Brass</span>
				    </li>
				    <li class="h-4 w-4 rounded-full border border-black border-opacity-10" style="background-color: #e5e7eb">
					    <span class="sr-only">Chrome</span>
            </li>
          </ul>
        </div>
      </a>
    </article>
    <article class="inline-flex w-full flex-col lg:w-auto | card">
	    <a href="#" class="card__wrap">
		    <div class="group relative">
			    <div class="aspect-h-1 aspect-w-1 overflow-hidden rounded-md bg-gray-200 | card__media">
				    <img
                 src="https://tailwindui.com/img/ecommerce-images/home-page-02-product-01.jpg"
                 alt="Black machined steel pen with hexagonal grip and small white logo at top."
                 class="h-full w-full object-cover object-center group-hover:opacity-75"
                 />
			    </div>
		    </div>
		    <div class="card__content">
			    <div class="card_description">
				    <p class="text-sm text-gray-500">Black</p>
				    <h3 class="mt-1 font-semibold text-gray-900">Machined Pen</h3>
				    <p class="mt-1 text-gray-400">
					    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Beatae corporis cupiditate
					    doloremque ea eum exercitationem explicabo facilis fugiat!
				    </p>
				    <p class="mt-1 text-gray-900">$35</p>
			    </div>
			    <h4 class="sr-only">Available colors</h4>
			    <ul role="list" class="mt-auto space-x-3 pt-6 | card__options">
				    <li class="h-4 w-4 rounded-full border border-black border-opacity-10" style="background-color: #111827">
					    <span class="sr-only">Black</span>
				    </li>
				    <li class="h-4 w-4 rounded-full border border-black border-opacity-10" style="background-color: #fde68a">
					    <span class="sr-only">Brass</span>
				    </li>
				    <li class="h-4 w-4 rounded-full border border-black border-opacity-10" style="background-color: #e5e7eb">
					    <span class="sr-only">Chrome</span>
            </li>
          </ul>
        </div>
      </a>
    </article>
  </main>
	<aside>
	  <article class="inline-flex w-full flex-col lg:w-auto | card">
	    <a href="#" class="card__wrap">
		    <div class="group relative">
			    <div class="aspect-h-1 aspect-w-1 overflow-hidden rounded-md bg-gray-200 | card__media">
				    <img
                 src="https://tailwindui.com/img/ecommerce-images/home-page-02-product-01.jpg"
                 alt="Black machined steel pen with hexagonal grip and small white logo at top."
                 class="h-full w-full object-cover object-center group-hover:opacity-75"
                 />
			    </div>
		    </div>
		    <div class="card__content">
			    <div class="card_description">
				    <p class="text-sm text-gray-500">Black</p>
				    <h3 class="mt-1 font-semibold text-gray-900">Machined Pen</h3>
				    <p class="mt-1 text-gray-400">
					    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Beatae corporis cupiditate
					    doloremque ea eum exercitationem explicabo facilis fugiat!
				    </p>
				    <p class="mt-1 text-gray-900">$35</p>
			    </div>
			    <h4 class="sr-only">Available colors</h4>
			    <ul role="list" class="mt-auto space-x-3 pt-6 | card__options">
				    <li class="h-4 w-4 rounded-full border border-black border-opacity-10" style="background-color: #111827">
					    <span class="sr-only">Black</span>
				    </li>
				    <li class="h-4 w-4 rounded-full border border-black border-opacity-10" style="background-color: #fde68a">
					    <span class="sr-only">Brass</span>
				    </li>
				    <li class="h-4 w-4 rounded-full border border-black border-opacity-10" style="background-color: #e5e7eb">
					    <span class="sr-only">Chrome</span>
            </li>
          </ul>
        </div>
      </a>
    </article>
	</aside>
</div>
              
            
!

CSS

              
                /* Card Styles */

.card {
  container-type: inline-size;
  container-name: card;
}

.card .card__media {
  flex-shrink: 0;
  width: 100%;
}

.card .card__content {
  margin-top: 15px;
  text-align: center;
}

.card .card__options {
  display: flex;
  justify-content: center;
  align-items: center;
}

@container card (min-width: 540px) {
  
  .card__wrap {
    display: flex;
    justify-content: start;
    align-items: center;
  }

  .card__media {
    width: 300px !important;
  }

  .card__content {
    margin: 0 0 0 20px;
    text-align: left !important;
  }

  .card__options {
    justify-content: flex-start !important;
  }

}

/* Sample Layout Styles */

.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px;
}

.layout main {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 20px;
}

.layout aside {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  grid-gap: 20px;
}

@media (min-width: 768px) {
  .layout main {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .layout aside {
    margin-top: 30px;
  }
}

@media (min-width: 1024px) {
  .layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: auto;
    grid-template-areas: "main main main sidebar";
    grid-gap: 40px;
  }
  
  .layout main {
    grid-area: main;
    grid-template-columns: 1fr;
  }
  
  .layout aside {
    grid-area: sidebar;
    margin-top: 0;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console