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.

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="container">
  <div class="row">
    <div class="col-8">
      <form>
        <div class="form-group">
          <label for="name">Name*</label>
          <input type="text" class="form-control is-valid" id="name" placeholder="Your name" value="John Doe" required>
          <div class="valid-feedback">
            Looks good!
          </div>
          <div class="invalid-feedback">
            Please add a name.
          </div>
        </div>

        <div class="form-group">
          <label for="telephone">Telephone*</label>
          <input type="text" class="form-control is-invalid" id="telephone" placeholder="Your telephone number" required minlength="7" maxlength="12">
          <div class="valid-feedback">
            Looks good!
          </div>
          <div class="invalid-feedback">
            Please choose a valid telephone number (between 7 and 10 characters).
          </div>
        </div>

        <div class="form-group">
          <label for="address">Address</label>
          <input type="text" class="form-control is-invalid" id="address" placeholder="Your delivery address" required>
          <div class="valid-feedback">
            Looks good!
          </div>
          <div class="invalid-feedback">
            Please add an address.
          </div>
        </div>

        <div class="form-group">
          <select class="custom-select is-invalid" required>
            <option value="">Select a menu*</option>
            <option value="1">Breakfast</option>
            <option value="2">Lunch</option>
            <option value="3">Dinner</option>
          </select>
          <div class="valid-feedback">
            Looks good!
          </div>
          <div class="invalid-feedback">
            Please choose a menu.
          </div>
        </div>

        <div class="form-group">
          <label>I need cutlery:</label>
          <div class="custom-control custom-radio">
              <input type="radio" id="yes" name="cutlery" class="custom-control-input is-invalid" required>
              <label class="custom-control-label" for="yes">Yes</label>
          </div>
          <div class="custom-control custom-radio">
              <input type="radio" id="no" name="cutlery" class="custom-control-input is-invalid" required>
              <label class="custom-control-label" for="no">No</label>
              <div class="valid-feedback">
                Looks good!
              </div>
              <div class="invalid-feedback">
                Please specify if you need cutlery.
              </div>
          </div>
        </div>
        <button type="submit" class="btn btn-info">Submit</button>
      </form>
    </div>
  </div>
</div>
              
            
!

CSS

              
                .container {
  padding: 3rem 0rem;
}

h4 {
  margin: 2rem 0rem 1rem;
}
.form-group {
  position: relative;
}
              
            
!

JS

              
                // Example starter JavaScript for disabling form submissions if there are invalid fields
(function() {
  'use strict';
  window.addEventListener('load', function() {
    // Fetch all the forms we want to apply custom Bootstrap validation styles to
    var forms = document.getElementsByClassName('needs-validation');
    // Loop over them and prevent submission
    var validation = Array.prototype.filter.call(forms, function(form) {
      form.addEventListener('submit', function(event) {
        if (form.checkValidity() === false) {
          event.preventDefault();
          event.stopPropagation();
        }
        form.classList.add('was-validated');
      }, false);
    });
  }, false);
})();


              
            
!
999px

Console