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="vertical-centered">

    Flexbox demo: vertical centering
  <p>We can center any element with an unknown height. Just use <code>items-align: center</code> for the container or <code>self-align: center</code> for the flex item.</p>

<p>In this example, even we align the entire height of the window, because we set the <code>body {height: 100vh; }</code>.</p> 

<p class="css-mine">
  (<a href="http://www.cssmine.com/ebook/css3-flexbox" target="_blank">CSS3 Flexbox</a> at CSS Mine)
              body { 
  height: 100vh;   
  margin: 0;
  padding: 0;
  display: flex;
  /* Vertical centering (cross axis): */
  align-items: center;
  /* Horizontal centering (main axis): */  
  justify-content: center;

.vertical-centered {  
  padding: 2em;
  background: #ddd;
  max-width: 50%;

/* Solution for no-flexbox browsers (proof of concept) */

.no-flexbox body {
    width: 100%;
    height: 100%;  

.no-flexbox .vertical-centered {
   margin: 0 auto;
   position: absolute;
   left: 50%;
   top: 50%;
   margin-top: -150px;
   margin-left: -25%;  

.css-mine {
  position: fixed;
  bottom: 0;

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 ..................