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 class="container">
  
<div class="flag note">
  <div class="flag__image note__icon">
    <i class="fa fa-heart"></i>
  </div>
  <div class="flag__body note__text">
    Default color
  </div>
  <a href="#" class="note__close">
    <i class="fa fa-times"></i>
  </a>
</div>
  
<div class="flag note note--secondary">
  <div class="flag__image note__icon">
    <i class="fa fa-comment"></i>
  </div>
  <div class="flag__body note__text">
    Secondary color
  </div>
  <a href="#" class="note__close">
    <i class="fa fa-times"></i>
  </a>
</div>

<div class="flag note note--success">
  <div class="flag__image note__icon">
    <i class="fa fa-check"></i>
  </div>
  <div class="flag__body note__text">
    Your thing was successful!
  </div>
  <a href="#" class="note__close">
    <i class="fa fa-times"></i>
  </a>
</div>
  
<div class="flag note note--warning">
  <div class="flag__image note__icon">
    <i class="fa fa-exclamation"></i>
  </div>
  <div class="flag__body note__text">
    Your thing was not so successful!
  </div>
  <a href="#" class="note__close">
    <i class="fa fa-times"></i>
  </a>
</div>
  
<div class="flag note note--error">
  <div class="flag__image note__icon">
    <i class="fa fa-times"></i>
  </div>
  <div class="flag__body note__text">
    Your thing failed completely!
  </div>
  <a href="#" class="note__close">
    <i class="fa fa-times"></i>
  </a>
</div>
  
<div class="flag note note--info">
  <div class="flag__image note__icon">
    <i class="fa fa-info"></i>
  </div>
  <div class="flag__body note__text">
    <p>I barely knew Philip, but as a clergyman I have no problem telling his most intimate friends all about him. Calculon is gonna kill us and it's all everybody else's fault! Is that a cooking show? When will that be? Shut up and get to the point! Bender, being God isn't easy. If you do too much, people get dependent on you, and if you do nothing, they lose hope. You have to use a light touch. Like a safecracker, or a pickpocket.</p>
  </div>
  <a href="#" class="note__close">
    <i class="fa fa-times"></i>
  </a>
</div>
  
</div>
              
            
!

CSS

              
                @import url(https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css);
@import url(https://fonts.googleapis.com/css?family=Roboto:700,400,300);
@import url(https://raw.github.com/necolas/normalize.css/master/normalize.css);

$spacing: 24px;

/**
* Set up reusable colors
*/
$main-color:           #9b59b6;
$secondary-color:      #34495e;
/**
* Colors from Flat UI
* Source: http://flatuicolors.com
*/
$pomegranate:          #c0392b;
$alizarin: 			      #e74c3c;
$pumpkin: 			       #d35400;
$carrot: 			        #e67e22;
$orange:               #f39c12;
$sunflower:            #f1c40f;
$emerald:              #2ecc71;
$nephritis:            #27ae60;
$turquoise:            #1abc9c;
$green-sea:            #16a085;
$peter-river:          #3498db;
$belize-hole:          #2980b9;
$amethyst:             #9b59b6;
$wisteria:             #8e44ad;
$clouds:               #ecf0f1;
$silver:               #bdc3c7;
$concrete:             #95a5a6;
$asbestos:             #7f8c8d;
$wet-asphalt:          #34495e;
$midnight-blue:        #2c3e50;


* { box-sizing: border-box; }

body {
  font-family: 'Roboto', sans-serif;
  line-height: 1.4;
  background-color: #e7e7e7;
}

.container {
  width: 70%;
  margin: 0 auto;
  padding: $spacing * 2;
}


/**
* This can be extended to anything to make it get slightly bigger on hover,
* which is a pretty commonly desired effect
*/
.big-on-hover {
  transform: scale(1, 1);
  &:hover {
    transform: scale(1.2, 1.2);
  }
}


/**
* Reusable single-direction margin declaration
*/
.margin {
  margin-top: 0;
  margin-bottom: $spacing;
  &:last-child {
    margin-bottom: 0;
  }
}

p {
  @extend .margin;
}

/**
* Flag Object
* Original Source: https://csswizardry.com/2013/05/the-flag-object/
*/
.flag {
  @extend .margin;
  display: table;
  width: 100%;
}

.flag__image,
.flag__body {
  display: table-cell;
  vertical-align: middle;
  .flag--top & {
    vertical-align: top;
  }
  .flag--bottom & {
    vertical-align: bottom;
  }
}

.flag__image {
  padding-right: $spacing;
  > img {
    display: block;
    max-width: none;
  }
  .flag--rev & {
    padding-right: 0;
    padding-left: $spacing;
  }
}

.flag__body {
  width: 100%;
}

  
/**
* Notification Styles
*/
.note {
  position: relative;
  overflow: hidden;
  color: white;
  background-color: $main-color;
}

.note--secondary { background-color: $secondary-color; }
.note--success   { background-color: $nephritis; }
.note--warning   { background-color: $orange; }
.note--error     { background-color: $alizarin; }
.note--info      { background-color: $peter-river; }

  .note__icon,
  .note__text {
    padding: $spacing;
  }

  .note__icon {
    min-width: ($spacing * 2) + 32px;
    text-align: center;
    font-size: 32px;
    font-size: 2rem;
    background-color: rgba(black, 0.25);
  }

  .note__text {
    padding-right: $spacing * 2;
  }

  .note__close {
    //@extend .big-on-hover;
    position: absolute;
    top: $spacing / 2;
    right: $spacing / 2;
    width: 29px;
    line-height: 30px;
    font-size: 24px;
    text-align: center;
    color: white;
    background-color: rgba(black, 0.25);
    opacity: 0;
    transition: all 0.25s;
    &:hover {
      background-color: rgba(black, 0.15);
    }
    .note:hover & {
      opacity: 1;
    }
  }



              
            
!

JS

              
                $(".note__close").click(function() {
  $(this).parent()
  .animate({ opacity: 0 }, 250, function() {
    $(this)
    .animate({ marginBottom: 0 }, 250)
    .children()
    .animate({ padding: 0 }, 250)
    .wrapInner("<div />")
    .children()
    .slideUp(250, function() {
      $(this).closest(".note").remove();
    });
  });
});
              
            
!
999px

Console