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.

            
              <script type="text/javascript" src="//use.typekit.net/rdv7feq.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>

<h2>Button styles</h2>
<button class="btn-red">subscribe</button>
<button class="btn-blue">log in</button>
<button class="btn-disabled">submit</button>

<br>
<br>
<br>

<h2>Form styles</h2>
<div class="modal">
  <div class="header">
    <div class="header-text">Sign up</div>
  </div>
  <div class="main">
    <div class="top">
      <p>Signing up gives you access to download images and choose from more virtual devices.</p>
      <div class="input-wrap">
        <label for="name">Name</label>
        <input name="name" placeholder="Name" />
      </div>
      <div class="input-wrap">
        <label for="email">Email Address</label>
        <input id="email" name="email" placeholder="Email Address" />
        <small>Please enter a valid email address</small>
      </div>
      <div class="input-wrap">
        <label for="name">Password</label>
        <input name="name" placeholder="Password" />
      </div>
      <button class="btn-disabled" style="float: right;">submit</button>
    </div>
    <div class="bottom">
      <p>Already have an account?</p>
      <button class="btn-blue">log in</button>
    </div>
  </div>
</div>

<aside>
  <h2>Form Styleguide Notes:</h2>
  <p>Input label floats on keyup so user doesn't lose context.</p>
  <p>Example error state example on email (active on blur, not keyup).</p>
  <p>Form modal max-width 460px.</p>
  <p>Submit --> red on valid form</p>
</aside>
     
            
          
!
            
              //Core colors
  $red: #f05244;
  $red-hover: #d34645;
  $blue: #01adb6;
  $blue-hover: #109b9b;
  $black: #222222;

  $darkText: #383b40;

  $light-grey: #eaeaea;
  $btn-disabled: #a1a1a1;

  *{
    box-sizing: border-box;
  }

//Extends for ease only (do mixins in prod)
.proxima-light{
  font-family: 'proxima-nova';
  font-weight: 300;
}
.proxima-regular{
  font-family: 'proxima-nova';
  font-weight: 400;
}
.proxima-semibold{
  font-family: 'proxima-nova';
  font-weight: 600;
}
.proxima-bold{
  font-family: 'proxima-nova';
  font-weight: 700;
}

%small-caps{
  @extend .proxima-bold;
  text-transform: lowercase;
  font-variant: small-caps;
  font-size: 20px;
  letter-spacing: .03em;
}

// Button styles
[class^="btn-"], [class*="btn-"]{
  outline: 0;
  @extend %small-caps;
  color: #fff;
  border: 0px;
  line-height: 38px;
  padding: 0 20px 2px 20px;
  margin: 0px;
  min-width: 100px;
  
  &:hover{
    cursor: pointer;
  }
}

.btn-red{
  background-color: $red;
  &:hover{
     background-color: $red-hover;
  }
}

.btn-blue{
  background-color: $blue;
  &:hover{
     background-color: $blue-hover;
  }
}

.btn-disabled{
  background-color: $btn-disabled;
  &:hover{
    cursor: auto;
  }
}

//form styles

.input-wrap {
  position:relative;
  margin-bottom:30px;
}
input{
  @extend .proxima-light;
  width: 100%;
  outline: 0;
  height: 45px;
  font-size: 18px;
  margin-bottom: 0px;
  padding-left: 10px;
  border: 1px solid #bbbdbf;
  
}
label {
  position:absolute;
  top:-13px;
  left:0;
  @extend .proxima-light;
  font-size:13px;
  transition: all 0.1s linear;
  opacity:0;
  color: $darkText;
  
  &.show {
    top:-15px;
    opacity:1;
  }
}

.modal{
  max-width: 460px;
  float: left;
  
  .header{
    display: block;
    overflow: hidden;
    @extend %small-caps;
    color: #fff;
    padding: 0 20px;
    line-height: 44px;
    font-size: 22px;
    background-color: $blue;
    border-bottom: 1px solid #bbbdbf;
    
  }
  
  .main{
    padding: 20px;
    background-color: $light-grey;
   
    
    p{
      @extend .proxima-light;
      text-align: center;
      margin: 0 0 20px 0;
    }
    
    .top{
      display: block;
      overflow: hidden;
      
      button{
        margin-top: -10px;
      }
    }
    .bottom{
      display: block;
      border-top: 1px solid #bbbdbf;
      text-align: center;
      margin-top: 20px;
      padding-top: 20px;
      
      p{
        margin: 0 0 10px 0;
      }
    }
  }
}

small{
  background-color: #f0a514;
  color: white;
  padding: 7px;
  width: 100%;
  display: block;
  font-family: proxima-nova;
}

h2{
  font-family: proxima-nova;
}
aside{
  float: left;
  margin-left: 20px;
  font-family: proxima-nova;
  display: block;
}
            
          
!
            
              $(function(){
  
  $('input').bind("isValue",function(){
    var label = $(this).prev("label");
    if(this.value !== ""){
      label.addClass('show');
    } else {
      label.removeClass('show');
    }
  }).on('keyup',function(){
    $(this).trigger("isValue");
  }).trigger("isValue");
  
});


            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console