Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

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.

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="got-gridbox">
<figure>
	<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/daenerys-targaryen.png" alt="Black and white photograph of Emilia Clarke as Daenerys Targaryen">
	<figcaption>Daenerys Targaryen</figcaption>
</figure>
<figure id="tyrion">
	<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/tyrion-lannister.png" alt="Black and white photograph of Peter Dinklage as Tyrion Lannister">
	<figcaption>Tyrion Lannister</figcaption>
</figure>
<figure>
	<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/jamie-lannister.png" alt="Black and white photograph of Nikolaj Coster-Waldau as Jamie Lannister">
	<figcaption>Jamie Lannister</figcaption>
</figure>
<figure>
	<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/jon-snow.png" alt="Black and white photograph of Kit Harington as Jon Snow">
	<figcaption>Jon Snow</figcaption>
</figure>
<figure>
	<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/robb-stark.png" alt="Black and white photograph of  Richard Madden as Robb Stark">
	<figcaption>Robb Stark</figcaption>
</figure>
<figure>
	<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/cersei-lannister.png" alt="Black and white photograph of Lena Headey as Cersei Lannister">
	<figcaption>Cersei Lannister</figcaption>
</figure>
</div>


</div>
              
            
!

CSS

              
                * { box-sizing: border-box; }
#got-gridbox { 
  display: flex; 
  flex-flow: row wrap; 
  justify-content: space-between;  
}
#got-gridbox figure {  
  border: 1px solid #333; 
  position: relative; 
  font-size: 0; margin: 0; 
  margin: 2% 0; 
  flex: 0 0 48%; 
}
#got-gridbox figure:nth-child(even) img { float: right; 
}
#got-gridbox figure img { 
  width: 60%; height: auto; 
  margin-top: -2rem;  
}
#got-gridbox figure figcaption { 
  position: absolute; right: 4%; 
  top: 5%; 
  font-family: Deseret, Trajan Pro, Trajan, Requiem, serif; 
  text-transform: uppercase;
  font-size: 1.6rem; text-align: right; 
}
#got-gridbox figure:nth-child(even) figcaption { 
  left: 4%; right: auto; 
  text-align: left; 
}
#got-gridbox figure:nth-last-child(-n+2) { 
  background-image: linear-gradient(transparent, transparent 80%, #111 81%); 
}

@media screen and (max-width: 900px) { 
  #got-gridbox figure figcaption { 
    font-size: 1.4rem; }
}

@media screen and (max-width: 800px) { 
	#got-gridbox figure figcaption { 
    font-size: 1.25rem; }
}

@media screen and (max-width: 750px) { 
	#got-gridbox figure { 
    flex: 0 0 100%; margin-bottom: 7%;  
  }
	#got-gridbox figure figcaption { 
    font-size: 1.6rem; 
  }
}

@media screen and (max-width: 450px) { 
	#got-gridbox figure figcaption { font-size: 1.2rem; width: 50%; }
}

              
            
!

JS

              
                
              
            
!
999px

Console