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="wrapper">
  <div class="form-item">
    <div class="input-group">
      <label for="name">Full name</label>
    <input type="text" id="name" placeholder="e.g: John Smith">
    </div>
  </div>
</div>

<div class="note">
  <p>This is a demo from the <a href="http://ishadeed.com/article/say-hello-to-css-container-queries/">container queries</a> article by Ahmad Shadeed</p>
</div>
              
            
!

CSS

              
                .form-item {
  container-type: inline-size;
  overflow: auto;
  resize: horizontal;
  margin: 100px auto;
}

.input-group {
  @container (min-width: 350px) {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    
    input {
      flex: 1;
    }
  }
}


label {
  display: block;
}

input {
  width: 100%;
  appearance: none;
  font-size: 16px;
  padding: 8px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg fill='%23898989' width='100pt' height='100pt' version='1.1' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg%3E%3Cpath d='m71.363 44.066c0 11.801-9.5664 21.363-21.367 21.363-11.797 0-21.363-9.5625-21.363-21.363 0-11.797 9.5664-21.363 21.363-21.363 11.805 0 21.367 9.5664 21.367 21.363z'/%3E%3Cpath d='m84.254 84.34c-8.7734-8.7539-20.883-14.168-34.254-14.168s-25.48 5.4141-34.254 14.168c8.7734 8.75 20.883 14.16 34.254 14.16s25.48-5.4102 34.254-14.16z'/%3E%3Cpath d='m50 1.5c-26.785 0-48.5 21.719-48.5 48.5 0 26.789 21.715 48.5 48.5 48.5s48.5-21.711 48.5-48.5c0-26.781-21.715-48.5-48.5-48.5zm0 91.562c-23.781 0-43.062-19.277-43.062-43.062 0-23.781 19.281-43.062 43.062-43.062 23.785 0 43.062 19.281 43.062 43.066 0 23.781-19.277 43.059-43.062 43.059z'/%3E%3C/g%3E%3C/svg%3E%0A");
  background-size: 20px 20px;
  background-position: left 10px center;
  background-repeat: no-repeat;
  border: 2px solid #dddbda;
  border-radius: 5px;
  padding-left: 40px;
  
  &:focus {
    background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg fill='%23545AF5' width='100pt' height='100pt' version='1.1' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg%3E%3Cpath d='m71.363 44.066c0 11.801-9.5664 21.363-21.367 21.363-11.797 0-21.363-9.5625-21.363-21.363 0-11.797 9.5664-21.363 21.363-21.363 11.805 0 21.367 9.5664 21.367 21.363z'/%3E%3Cpath d='m84.254 84.34c-8.7734-8.7539-20.883-14.168-34.254-14.168s-25.48 5.4141-34.254 14.168c8.7734 8.75 20.883 14.16 34.254 14.16s25.48-5.4102 34.254-14.16z'/%3E%3Cpath d='m50 1.5c-26.785 0-48.5 21.719-48.5 48.5 0 26.789 21.715 48.5 48.5 48.5s48.5-21.711 48.5-48.5c0-26.781-21.715-48.5-48.5-48.5zm0 91.562c-23.781 0-43.062-19.277-43.062-43.062 0-23.781 19.281-43.062 43.062-43.062 23.785 0 43.062 19.281 43.062 43.066 0 23.781-19.277 43.059-43.062 43.059z'/%3E%3C/g%3E%3C/svg%3E%0A");
    outline: none;
    border-color: #545AF5;
  }
}

.note {
  padding: 1rem;
  margin-top: 1rem;
  text-align: center;
}

body {
  padding: 1rem;
  line-height: 1.5;
  font-family: "Rubik";
}

* {
  box-sizing: border-box;
}

              
            
!

JS

              
                
              
            
!
999px

Console