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 id="animals">
  <img class="animalIcon" src="http://macloo.com/images/african_animals/rhino.png" alt="An animal icon">
  <img class="animalIcon" src="http://macloo.com/images/african_animals/zebra.png" alt="An animal icon">
  <img class="animalIcon" src="http://macloo.com/images/african_animals/elephant.png" alt="An animal icon">
  <img class="animalIcon" src="http://macloo.com/images/african_animals/giraffe.png" alt="An animal icon">
  <img class="animalIcon" src="http://macloo.com/images/african_animals/lion.png" alt="An animal icon">
</div>
<p>Five images above center automatically because of Flexbox styles.</p>

<div id="singles">
<div class="single">
  <img class="animalIcon" src="http://macloo.com/images/african_animals/lion.png" alt="An animal icon">
  <h3>King of the Jungle</h3>
  <p>Lions have been listed as Vulnerable on the IUCN Red List since 1996, as populations in African range countries declined by about 43% since the early 1990s. Lion populations are untenable outside designated protected areas. Although the cause of the decline is not fully understood, habitat loss and conflicts with humans are the greatest causes of concern. The West African lion population is listed as Critically Endangered since 2016.</p>
</div>
<div class="single">
  <img class="animalIcon" src="http://macloo.com/images/african_animals/zebra.png" alt="An animal icon">
  <h3>In Black and White</h3>
  <p>The unique stripes of zebras make them one of the animals most familiar to people. They occur in a variety of habitats, such as grasslands, savannas, woodlands, thorny scrublands, mountains, and coastal hills. However, various anthropogenic factors have had a severe impact on zebra populations, in particular hunting for skins and habitat destruction. Grévy's zebra and the mountain zebra are endangered.</p>
</div>
</div>
              
            
!

CSS

              
                * {
  box-sizing: border-box;
}
body {
  padding: 2rem;
}
/* this is the container element for the top section 
   it contains only images 
   */
#animals {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  border: 1px solid #999;
}
/* this is the container element for the lower section 
   it contains two content DIVs, each having the class "single"  
   */
#singles {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}
/* animal info boxes */
.single {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid #c00;
  padding: 1rem 2rem;
  margin: 1rem 0;
  flex-basis: 49%;
}
.animalIcon {
  padding: 1em 0.5rem;
}
@media (max-width: 700px) {
  .single {
    flex-basis: 100%;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console