Pen Settings



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


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


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.


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.


                <div class="control">
  <div class="switch-container">
    <input type="checkbox" id="switch" checked/>
    <label for="switch" class="label"></label>

  <select id="select">
    <option value="left 10%" selected="">left 10%</option>
    <option value="50%">50%</option>
    <option value="0 10px">0 10px</option>
    <option value="top center">top center</option>
    <option value="bottom 20px right 50px">bottom 20px right 50px</option>

<div class="container">
  <div class="element">
    Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo possimus quis, accusantium officiis enim mollitia nam recusandae architecto? Deserunt, rem sed repellat animi quas consectetur consequatur quisquam id hic mollitia exercitationem, laudantium nam minus itaque necessitatibus doloremque officiis velit? Perspiciatis fugiat optio alias magni veniam reprehenderit, officia quos repellendus eveniet aperiam iure beatae aut? Necessitatibus autem fugit quasi nam earum modi quaerat nemo blanditiis nulla officiis alias, harum labore. Officiis ut optio nobis expedita temporibus voluptates in, autem consequuntur dolore ratione quasi corporis doloremque ab culpa exercitationem? Inventore voluptates assumenda itaque consequatur asperiores officiis debitis sunt minima? Dolor, commodi distinctio.


                body { 
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  font-family: Helvetica, sans-serif;

.control {  
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 600px;
  max-width: 100%;
  gap: .5em;
  padding: 3em 1em;

.switch-container {
  display: flex;
  align-items: center;
  gap: .5em;

.label {
  cursor: pointer;

.label::after {
  content: "No Mask";

#switch:checked + .label::after {
  content: "Mask";

.container {
  display: block;
  max-width: 400px;
  border: 2px dashed #ccc;

.element {
  background-image: linear-gradient( 135deg, #CE9FFC 10%, #7367F0 100%);
  /* */
  line-height: 1.6;
  text-align: justify;
  color: #646464;
  color: #fff;
  padding: 0 1em;
  -webkit-mask-image: url(;
          mask-image: url(;
  -webkit-mask-size: 200px 200px;
          mask-size: 200px 200px;          
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;


                    var element = document.querySelector('.element'),
    checkbox = document.querySelector('#switch');

    checkbox.addEventListener('change', function () {
      if(checkbox.checked) {        = 'url('; = 'url('; 
      else { = 'none'; = 'none'; 
    }, false);   
    var select = document.querySelector('#select');
    select.addEventListener("change", function (e) { =; =;