css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div class="box">
  <h1>
    			Hover to Animate Me
		  </h1>
</div>

<p class="p">Demo by Maria Antonietta Perna. <a href="http://www.sitepoint.com/close-up-css-mix-blend-mode-property" target="_blank">See article</a>.</p>
            
          
!
            
              /* Fake animation of mix-blend-mode on the text using Dave Lunny's technique for animating CSS3 gradients.  You can find Dave Lunny's work around here: 
https://medium.com/@dave_lunny/animating-css-gradients-using-only-css-d2fd7671e759 */

@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:700);
* {
  box-sizing: border-box;
}

body {
  background-color: #555;
  font-size: 1.5em;
  font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
}

.box {
  background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/123941/source.jpg) no-repeat;
  background-size: cover;
  border: 1px solid #555;
  text-align: center;
  margin: 1em auto;
  padding: 300px 0 0;
  width: 100%;
  max-width: 600px;
  mix-blend-mode: luminosity;
}

.box h1 {
  background-color: #c5eff7;
  color: #22a7f0;
  position: relative;
  bottom: 2em;
  line-height: 1.2;
  mix-blend-mode: hard-light;
}
/*create duplicate of h1 and place it  on top of the original element.  Set its opacity to 0 to reveal the original.  Transitioning the duplicate's opacity value to 1 on hover covers the original h1 elment and displays the duplicate with a different blend mode and an animation effect.*/

.box h1:before {
  content: "Hover to Animate Me";
  color: green;
  display: block;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  mix-blend-mode: multiply;
  transition: opacity .5s linear;
}

.box:hover h1:before {
  opacity: 1;
}

.p {
  text-align: center;
  padding-top: 100px;
  font-size: 13px;
  font-weight: normal;
  font-family: Arial;
}
            
          
!
            
              // http://www.sitepoint.com/close-up-css-mix-blend-mode-property
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console