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

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              
<link href="https://fonts.googleapis.com/css?family=Karla:400,700" rel="stylesheet">

<div class="form-container">
 
  <div class="message-container">
  <div class="message">Welcome</div>
  </div>
  
  <div class="inputs-container">
  <input class="input input__email" type="text" placeholder="Email Address" name="uname">
  
  <input class="input input__password" type="password" placeholder="Password" name="pwd">
  </div>
  
  <div class="buttons-container">
  <button class="option option__login">Log In</button>
    
  <button class="option option__signup">Sign Up</button>
  </div>
  
  <p class="i-forgot">Reset</p>
 
</div>
            
          
!
            
              body, html {
  font-family: 'Karla', sans-serif;
}

.message-container {
  width: 300px;
}

.message-container--error {
  background-color: rgba(255, 0, 0, 0.5);
  border-radius: 5px;
  padding: 10px;
}

.message {
  font-size: 20px;
  font-weight: 700;
  color: #5d6168;
  text-align: center;
}

.form-container {
  display: flex;
  flex-direction: column;
  width: 420px;
  height: 400px;
  margin: 30px auto;
  align-items: center;
  justify-content: center;
  background-color: #e8ecf2;
  border-radius: 4px;
}

.inputs-container {
  display: flex;
  flex-direction: column;
}

.input {
  width: 270px;
  height: 35px;
  margin: 10px;
  font-size: 16px;
  border: 1px solid #d0d7e0;
  border-radius: 3px;
  text-indent: 10px;
}

.input:focus {
  text-indent: 10px;
  outline: none;
  transition: 0.2s linear;
  box-shadow: 0px 0px 18px -2px rgba(0,0,0,0.15); 
}

.input::placeholder {
  color: #b8bec6;
  text-indent: 10px;
}

.input::placeholder-shown {
  text-indent: 10px;
}

.input:nth-child(1) {
  margin-top: 20px;
}

.buttons-container {
  display: flex;
  flex-direction: row;
}

.option {
  width: 125px;
  height: 40px;
  margin: 10px;
  border: none;
  border-radius: 3px;
  font-size: 16px;
  background-color: #d2d6db;
  color: #7b7e82;
  outline: none;
  cursor: pointer;
}

.option:hover {
  transition: 0.25s linear all;
  background-color: #969fad;
  color: #fff;
}

.input--error {
  border: 1px solid red;
  box-shadow: 0px 0px 20px 0px rgba(255,0,0,0.2);
}

.i-forgot {
  cursor: pointer;
  text-decoration: underline;
}
            
          
!
            
              $(function(){
  $(".option__login").click(function(){
    $(".input__email").addClass("input--error")
    $(".message").text("An account with that email is not recognised")
    $(".message-container").addClass("message-container--error");
  });
});

$(function(){
  $(".i-forgot").click(function(){
    $(".input__email").removeClass("input--error")
    $(".message").text("Welcome")
    $(".message-container").removeClass("message-container--error");
  });
});
            
          
!
999px
Loading ..................

Console