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

              
                .container.mt-5
  .row
    .col-md-5.d-flex.align-items-center
      h1 Sliding labels for Bootstrap forms
    .col-md-6.offset-md-1
      form.mt-4.mt-md-0
      
        .form-group
          label(for="name")
            | Name
          input.form-control(type='text')
          
        .form-group
          label(for="surname")
            | Surname
          input.form-control(type='text')
          
        .form-group
          label(for="email")
            | E-mail
          input.form-control(type='email')
              
            
!

CSS

              
                @import 'https://fonts.googleapis.com/css?family=Libre+Franklin:100,300,400,600,700,900'

$primary = #ff8d00
$box-shadow--vertical = 0 3px 6px 6px 
$dark = #111922
$grey-light = #a1a2a3

/* -----------------------
  Presentational stuff 
----------------------- */  
body
  font-family 'Libre Franklin', sans-serif
  background $dark
  
h1 
  font-weight 900
  // text-transform uppercase
  color $primary
  @media (min-width: 1200px) 
    font-size 60px 
  

/* -----------------------
  Form 
----------------------- */  
.form-control
  border-radius 0 
  &:focus
    box-shadow none
    
.form-group
  position relative             
  margin-bottom 25px

  > label
    text-transform uppercase
    font-size 10px
    color $grey-light
    transform-origin 0 0            
    transform scale(1.4)            
    pointer-events none             
    position relative    
    z-index 5                      
  
  > input 
    width 100%

  // Label dinamica
  > label
    transition transform .4s
    transform-origin 0 0
    transform scale(1.4) translateY(20px)

  &.not-empty
    > label 
      transform none

// .form-group 
 

 
/*------------------------------
	Form
------------------------------*/
.form-control
  border 0
  border-bottom 1px solid $grey-light
  &, &:focus, &:focus:hover 
    color $primary
    background none 
    outline none    
  &:focus, &:focus:hover 
    border-bottom 1px solid $primary

              
            
!

JS

              
                $( () => {

  $('.form-group').each((i,e) => {
    $('.form-control', e)
      .focus( function () {
        e.classList.add('not-empty');
      })
      .blur( function () {
        this.value === '' ? e.classList.remove('not-empty') : null;
      })
    ;
  });
  
});  
  
 
              
            
!
999px

Console