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

              <!-- Optional content you want to persist between sections -->
<div class="content">BLEND</div>

<section class="one">
  <div class="wrapper"></div>

<section class="two">
  <div class="wrapper"></div>

<section class="three">
  <div class="wrapper"></div>

<section class="four">
  <div class="wrapper"></div>
              %fixedbox {
  // Basic styling
  box-sizing: border-box;
  display: block;
  font-size: 4em;
  padding: 1em;
  width: 6em;
  height: 3em;
  // Center box in middle of screen
  position: fixed; 
    top: 50%;
    left: 50%;
  transform: translate3d(-50%,-50%,0);

.content {
    // Basic styling
    @extend %fixedbox;
    font-weight: bold;
    text-align: center;
    z-index: 1000;
    // Cut-out text effect
    background: #fff;
    color: #000;
    mix-blend-mode: lighten;

section {
  // Background image styling
  background-repeat: no-repeat;
  background-size: cover;
  // Reset stacking context
  isolation: isolate;
  // Must be set to correctly position .wrapper below
  position: relative;
  // Height not required. Can be left as auto
  height: 100vh;
  padding: 1em;

.wrapper {
  // Hides box (&:before) outside of section
  clip: rect(auto auto auto auto);
  // Clip works only on positions absolute or fixed
  position: absolute; 
  // Stretch to fill entire section
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
  &:before {
    content: " ";
    // Basic styling
    @extend %fixedbox;
    padding: 2em 3.5em;
    // Blend with background
    mix-blend-mode: darken;


.one {
  // Section background image
  background-image: url(https://source.unsplash.com/1920x1080?nature);
  .wrapper:before {
    // Box background color
    background: red;

.two {
  background-image: url(https://source.unsplash.com/1920x1080?landscape);
  .wrapper:before {
    background: #faaa54;
    mix-blend-mode: difference;

.three {
  background-image: url(https://source.unsplash.com/1920x1080?portrait);
  .wrapper:before {
    background: #6c320a;
    mix-blend-mode: screen;

.four {
  background-image: url(https://source.unsplash.com/1920x1080?stars);
  .wrapper:before {
    background: #e4135d;
🕑 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 ..................