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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

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.

HTML

            
              <div class="page-wrap">
  <div class="container">
    <h1><span>C</span><span>S</span><span>S</span> <span>B</span><span>l</span><span>e</span><span>n</span><span>d</span></h1>
    <p>CSS Blend Modes let us blend an element&rsquo;s background layer with another layer. They allow blending between background images, gradients, and background colors.</p>
    <form>
      <label for="color">Pick a CSS Blend Mode:</label>
      <select id="color" class="jsColor">
        <option value="normal">normal</option>
        <option value="color">color</option>
        <option value="color-burn">color-burn</option>
        <option value="color-dodge">color-dodge</option>
        <option value="darken">darken</option>
        <option value="difference">difference</option>
        <option value="exclusion">exclusion</option>
        <option value="hard-light">hard-light</option>
        <option value="hue">hue</option>
        <option value="lighten">lighten</option>
        <option value="luminosity">luminosity</option>
        <option value="multiply">multiply</option>
        <option value="overlay">overlay</option>
        <option value="saturation">saturation</option>
        <option value="screen">screen</option>
        <option value="soft-light">soft-light</option>
      </select>
    </form>
  </div>
</div>
            
          
!

CSS

            
              body {
  margin: 0;
  font-family: Georgia, serif;
}

.page-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: url('https://picsum.photos/id/1039/6945/4635') no-repeat, linear-gradient(to left, #225378, #1695A3);
  background-blend-mode: normal;
  background-size: cover;
}

.container {
  width: 80%;
  color: #FFF;
}

h1 {
  font-size: 8rem;
  margin-bottom: .5rem;
  letter-spacing: -1.25rem;
  color: #1695A3;
}

h1 span:nth-child(2n) {
  color: #225378;  
}

h1 span {
  mix-blend-mode: screen;
}

p,
label {
  font-size: 1.5rem;
  font-weight: 700;
}

select {
  margin-top: 1rem;
  display: block;
}

@media screen and (min-width: 1024px) {
  .page-wrap {
    padding-right: 2.5%;
    justify-content: flex-end;
  }    
  
  .container {
    max-width: 45%;
  }
  
}
            
          
!

JS

            
              /* Get the Form Element */
const form = document.querySelector('form');
/* Get the Background Container */
const background = document.querySelector('.page-wrap');
/* Create function to change the blend mode to the user's selection */
const updateBlendMode = () => {
  const selection = document.querySelector('.jsColor').value;
  background.style.backgroundBlendMode = selection;
};
/* Don't let the form submit */
form.addEventListener('submit',(e) => {
  e.preventDefault();
});
/* Update the blend mode when the user changes the form */
form.addEventListener('change',() => {
  updateBlendMode();
});

/* Initially update the blend mode to the default on page load */
updateBlendMode();


            
          
!
999px

Console