cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

  <h1>New User Signup</h1>
  <label for="pass" class="pass-label">Password - <span class="tip-icon"></span> 
    <ul class="tip">
      <li>The password length must be greater than or equal to 7</li>
      <li>The password must contain one or more uppercase characters</li>
      <li>The password must contain one or more lowercase characters</li>
      <li>The password must contain one or more numeric values</li>
      <li>The password must contain one or more special characters</li>
    <input id="pass" type="password" required pattern="(?=^.{7,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$"></label><label for="pass-confirm" class="pass-label">Confirm Password
    <input id="pass-confirm" type="password" required></label>
      <input type="submit" class="submit"/>

              $success: #007621;
$required: #B00000;
$error: #DC0809;
$black: #000000;
$white: #fff;
$grey: #aaaaaa;

html, body{
  font-family: Helvetica, Arial, sans-serif;

body {
  background: rgb(244,239,241);
  background: radial-gradient(ellipse at center,  rgba(244,239,241,1) 0%,rgba(80,90,100,1) 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4eff1', endColorstr='#dfd2f7',GradientType=1 );

form {
  position: relative;
  padding: 20px;
  height: 100%;
  width: 60%;
  margin: auto;

label {
  display: inline-block;

input:not([type=submit]) {
  border: 1px solid $grey;
  padding: 5px;
  transition:border-color 500ms;
  /* Mark required fields */
  &:required {
    border-right: 2px solid $required;
  :required:valid will change the red required mark to green when requirement is met.
  good for input patterns:
  &:valid {
    border-right: 2px solid $success;
  &.error {
    border: 1px solid $error;
  &:focus {
    outline: 0 none;

.pass-label {
  width: 47%;
  margin-right: 5%;
    margin-right: 0;

input[type=password] {

.tip-icon {
  color: $white;
  line-height: 1em;
  margin-bottom: 10px;
    content: '?';
    position: absolute;
    background: #333;
    padding: 3px 3px 3px 1px;
    border-radius: 3px;
    width: 12px;
    height: 12px;
    text-align: center;
  &:hover ~ .tip {
  ~ .tip {
    height: 0;
    position: absolute;
    background: lighten($grey, 20%);
    transition: height 500ms ease-in-out;  
    margin: 0;
    li {
      padding: 5px;

em {
  font-size: small;
  color: $grey;


              // Registration passwords should match
var password = document.getElementById('pass'),
  passwordConfirm = document.getElementById('pass-confirm'),
  errorInputs = document.getElementsByClassName('has-error'),
  registrationUtils = {};

 * Save the user from having to find out their
 * passwords dont match after save by checking now
 * and updating browser validity message with our own.
 * @return {bool}
registrationUtils.confirmMatch = function() {
  if (password.value !== passwordConfirm.value) {
    passwordConfirm.setCustomValidity('Passwords do not match');
  } else {
  return true;

 * Check that the password meets our security policy
 * @return {bool}
registrationUtils.validatePasswordPolicy = function() {

  var policy = new RegExp(password.pattern);

  if (!policy.test(password.value)) {
    password.setCustomValidity('Password does not meet requirements (try "aBc+123")');
  } else {

  return password.validity.valid;

 * Remove error styling from fields onfocus
 * @param  {object} input DOM element with error
 * @return {bool}
registrationUtils.removeErrorClass = function(input) {
  input.className = '';
  return true;

 * Bind util methods to objects in DOM
 * @type {object}
password.onchange = registrationUtils.validatePasswordPolicy;
passwordConfirm.onkeyup = registrationUtils.confirmMatch;

// loop through all the inputs with errors
for (var i = errorInputs.length - 1; i >= 0; i--) {
  errorInputs[i].onfocus = registrationUtils.removeErrorClass.bind(null, errorInputs[i]);
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................