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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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="content">
  <div class="notification green">
    <div class="info">
      <h1>This is a <a href="https://goo.gl/GykQEn">notification</a></h1>
      <p>You have been notified</p>
    </div>
    <div class="icon">
      <i class="fa fa-asterisk"></i>
    </div>
  </div>

  <div class="notification red">
    <div class="info">
      <h1><a href="https://goo.gl/IiwBDn">ruandre</a> followed you</h1>
      <p>You have a new follower! Feel the fame flow through your vains!</p>
    </div>
    <div class="icon">
      <i class="fa fa-heart"></i>
    </div>
  </div>

  <div class="notification blue">
    <div class="info">
      <h1><a href="https://goo.gl/I8lNLu">Windows 10</a> preview is here</h1>
      <p>Windows 10 represents the first step of a whole new generation of Windows. Windows 10 unlocks new experiences for customers to work, play and connect.</p>
      <a href="https://goo.gl/Z83wbD" class="button">Full story</a><a href="#" class="button gray">Dismiss</a>
    </div>
    <div class="icon">
      <i class="fa fa-newspaper-o"></i>
    </div>
  </div>

  <div class="notification purple">
    <div class="info">
      <h1><a>8 min</a> to home with a bicycle</h1>
      <p>Bicycle 2.4 km, 8 min. Use caution - may involve errors or sections not suited for bicycling</p>
      <a href="https://goo.gl/YbvshI" class="button">Navigate</a><a href="#" class="button gray">Dismiss</a>
    </div>
    <div class="icon">
      <i class="fa fa-bicycle"></i>
    </div>
  </div>

  <div class="notification blue">
    <div class="info">
      <h1><a href="https://goo.gl/C1PuL7">@munkkeli</a> followed you!</h1>
      <p>You have a new follower! Feel the fame flow through your vains!</p>
    </div>
    <div class="icon">
      <i class="fa fa-twitter"></i>
    </div>
  </div>
</div>



<!-- This is for the preview at codepen.io :) -->
<div id="preview">
  <div class="notification purple">
    <div class="info">
      <h1><a>8 min</a> to home with a bicycle</h1>
      <p>Bicycle 2.4 km, 8 min. Use caution - may involve errors or sections not suited for bicycling</p>
      <a href="https://goo.gl/YbvshI" class="button">Navigate</a><a href="#" class="button gray">Dismiss</a>
    </div>
    <div class="icon">
      <i class="fa fa-bicycle"></i>
    </div>
  </div>

  <p id="text">Make you view height larger to see the full thing ;)</p>
</div>
              
            
!

CSS

              
                .notification {
    -webkit-display: flex;
    display: flex;
    margin: 0 auto 10px auto;
    width: 350px;
    min-height: 70px;
    
    & .info {
        -webkit-flex: 1;
        flex: 1;
        padding: 10px 10px 0 10px;
        background: #ecf0f1;
        border-radius: 3px 0 0 3px;
        border-bottom: 3px solid darken(#ecf0f1, 15%);
        
        & h1 {
            margin: 0;
            padding: 0;
            font-family: arial, sans-serif;
            font-size: 16px;
            color: #111;
            
            & a {
                text-decoration: none;
                color: #444;
            }
        }
        
        & p {
            margin: 0;
            padding: 5px 0;
            font-family: arial, sans-serif;
            font-size: 12px;
            color: #666;
        }
        
        & .button {
            display: inline-block;
            margin: 3px 3px 5px 0;
            padding: 3px 7px;
            border-radius: 2px;
            border-bottom: 1px solid;
            font-family: arial, sans-serif;
            font-size: 12px;
            font-weight: bold;
            text-decoration: none;
            color: #ecf0f1;
            
            &.blue {
                .button(#2980b9);   
            }
            &.red {
                .button(#e74c3c);
            }
            &.orange {
                .button(#f39c12);
            }
            &.purple {
                .button(#9b59b6);
            }
            &.green {
                .button(#27ae60);
            }
            &.gray {
                .button(#95a5a6);
            }
        }
    }
    
    & .icon {
        padding: 15px 0 0 0;
        width: 70px;
        border-radius: 0 3px 3px 0;
        text-align: center;
        font-size: 32px;
        color: #ecf0f1;
        border-bottom: 3px solid;
    }
    
    .color(#7f8c8d);
    
    &.blue {
        .color(#2980b9);   
    }
    &.red {
        .color(#e74c3c);
    }
    &.orange {
        .color(#f39c12);
    }
    &.purple {
        .color(#9b59b6);
    }
    &.green {
        .color(#27ae60);
    }
    &.gray {
        .color(#95a5a6);
    }
}

.color(@color) {
    & .icon {
        background: @color;
        border-bottom-color: darken(@color, 10%);
    }
    
    & .info {
        & .button {
            background: @color;
            border-bottom-color: darken(@color, 10%);
        }
    }
}

.button(@color) {
    background: @color !important;
    border-bottom-color: darken(@color, 10%) !important;
}



/*
* The styles to setup this scene
*/

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

body {
    padding: 100px;
    background: #34495e;
}

#content {
    display: block;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

#preview {
    display: none;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    
    & #text {
        text-align: center;
        color: #fff;
        font-family: arial, sans-serif;
        font-size: 12px;
    }
}

@media (max-height: 400px) {
    #content {
        display: none;
    }

    #preview {
        display: block;
    }
}
              
            
!

JS

              
                
              
            
!
999px

Console