cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmloctocatspinnerstartv

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.

            
              <figure>
  <img src="http://lorempixel.com/output/city-q-c-200-200-7.jpg" alt="">
  <figcaption>
    Picture
  </figcaption>
</figure>

<div class="show-me">
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>  
</div>

            
          
!
            
              * {
  box-sizing:border-box;
}

figure, div {
  float:left;
  width:200px;
  height:200px;
  margin:25px;
}

div {
  padding:10px;
  background:grey;
}

img {
  display:block;
}

/* the above is just basic styling and not related to funtionality */

/* IMAGE EXAMPLE */

figcaption {
  width:inherit;
  height:inherit;
  text-align:center;
  line-height:200px; /* just to center the text in the box */
  display:none; /* hides it until needed */
  color:white;
 }

figure:hover figcaption {
  background-color: rgba(0,0,0,0.5);
  display:block; /* now you can see it */
  position:relative;
  top:-100%; /* moved to cover the image*/ 
}


/* DIV EXAMPLE */

.show-me {
  position:relative; /*needed to set positioning context */
}

.show-me:hover:after {
  content:"Insert Text Here";
  position:absolute;
  top:0;
  left:0;
  width:inherit;
  height:inherit;
  text-align:center;
  color:white;
  line-height:200px;
  background-color: rgba(0,0,0,0.5);
}
  

            
          
!
999px
Close

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.

Go PRO

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

Console