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">
  <h2>Basketball</h2>
  <p>Basketball is a non-contact sport played on a rectangular court.</p>
</div>
<div class="item">
  <h2>Team sport</h2>
  <p>Most often played as a team sport with five players on each side.</p>
</div>
<div class="item">
  <h2>Objective</h2>
  <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>
<div class="item">
  <h2>Creation</h2>
  <p>The game was invented in 1891 by Dr. James Naismith.</p>
</div>
<div id="hero" class="item">
  <h2>An outdoor basketball net</h2>     
</div>
</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-size:cover;
  background-position: center;
}

.credit {
  padding: 1em;
  font-size: 90%;
  color: gray;
}
            
          
!
999px
Loading ..................

Console