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

              
                <!-- LIBRARY INITIALIZATION -->
<script type="text/javascript">
  var _iub = _iub || {};
  _iub.cons_instructions = _iub.cons_instructions || [];
  _iub.cons_instructions.push(["init",{api_key:"4hXF27pDbQXPUyqx14smDoxU5yymGj5T"},function( ){
    console.log("init callBack");
  }]);
</script>
<script type="text/javascript" src="https://cdn.iubenda.com/cons/beta/iubenda_cons.js"></script>
<!-- FORM -->
<form id="form">
  <div>
    <label>Name</label>
    <input type="text" name="name" />
  </div>
  <div>
    <label>Surname</label>
    <input type="text" name="surname"/>
  </div>
  <div>
    <label>Email</label>
    <input type="text" name="email"  />
  </div>
  <div>
    <p>
      <input type="checkbox" name="documents" />
      I've read the Privacy Policy and accept the Terms and Condition
    </p>
    <p>
      <input type="checkbox" name="newsletter" />
      I agree to receiving a newsletter with information and offers regarding this service (optional)
    </p>    
    <p>
      <input type="checkbox" name="dem" />
      I agree to receiving a newsletter with information and offers about products and services by third parties (optional)
    </p>
  </div>
  <div>
    <button id="submit_button">Send</button>
  </div>
</form>
<script>
   /** LOAD */
   _iub.cons_instructions.push(["load",{
          submitElement: document.getElementById("submit_button"),
          form: {
            selector: document.getElementById("form"),
            map: {          
              subject: {           
                first_name: "name",
                last_name: "surname",
                email: "email"
              },
              preferences: {
                legal_documents: "documents",
                newsletter: "newsletter",
                dem: "dem"
              }
            }
          },
          consent: {
            legal_notices: [
              {
                identifier: 'privacy_policy',
              },     
              {
                identifier: 'cookie_policy',
              },         
              {
                identifier: 'term',
              }
            ],
          }
      }]);
</script>
              
            
!

CSS

              
                * {
  box-sizing:border-box;
}
body {
  background: #F4F4F4;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Open sans, Helvetica Neue, sans-serif;
  color: #4D4D4D;
}
form {
  max-width: 320px;
  min-width: 320px;
  margin: 64px auto;
  background: #FFF;
  padding: 1rem;
  border-radius: 4px;
  box-shadow: 0 0 32px rgba(0,0,0,0.02);
}

label.error {
  display: block;
  font-size: 12px;
  color: #FF5D4D;
  margin-top: .25rem;
}

form > div {
  margin-bottom: .5rem;
}

input,button {
  margin:0;
  padding: 1rem;
  font-size: 100%;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 1px 0 0 rgba(0,0,0,0.02);
}

label {
  display:block;
  overflow:hidden;
  margin-bottom: 4px;
}

.field {
  margin-bottom: 24px;
  clear: both;
}

.field input[type=checkbox] {
  float: left;
  margin-right: 8px;
}

input[type=text] {
  width: 100%;
}

input:focus {
  outline: 0;
  border-color: #1CC691;
}

button {
  background: #1CC691;
  color: #FFF;
  cursor: pointer;
}

.text-right {
  text-align: right;
}
              
            
!

JS

              
                
              
            
!
999px

Console