cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation


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.

              <div class="grid">
<div class="item">
  <p>Basketball is a non-contact sport played on a rectangular court.</p>
<div class="item">
  <h2>Team sport</h2>
  <p>Most often played as a team sport with five players on each side.</p>
<div class="item">
  <p>The objective is to shoot a ball through a hoop that is mounted to a backboard at each end of the court. </p>
<div class="item">
  <p>The game was invented in 1891 by Dr. James Naismith.</p>
<div id="hero" class="item">
  <h2>An outdoor basketball net</h2>     
</div> <!-- /l-grid -->
<p class="credit">All text and images from Wikipedia.</p>
              * { 
  box-sizing: border-box;

.grid {
  padding: 1em;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 16em 16em;
  grid-gap: 1em;

.item { 
  padding: 1em;
  background: #ccc;
  // border: 1px solid black;

#hero {
  background-image: url(https://upload.wikimedia.org/wikipedia/commons/4/4e/Basketball_Goal.jpg);
  background-position: center;

.credit {
  padding: 1em;
  font-size: 90%;
  color: gray;

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.


Loading ..................