Move Placeholder Above the Animation Input on Focus In Pure CSS

Input Animation is a pure CSS implementation of the Float Lable style as seen in Android and iOS.

floating label input css, floating label for select box css, floating placeholder css, floating label css, floating label like bootstrap, floating label css without required

How to make use of it:

1. Wrap the input field with a placeholder to a label element as follows:

<label class="custom-field">
  <input type="text" required/>
  <span class="placeholder">Animated Placeholder</span>
</label>

2. Style the custom input field and move the placeholder to the top of that input field.

.custom-field {
  position: relative;
  font-size: 14px;
  padding-top: 20px;
}

.custom-field input {
  border: none;
  -webkit-appearance: none;
  -ms-appearance: none;
  -moz-appearance: none ;
  appearance: none;
  outline: none;
  background-color: #f2f2f2;
  padding: 12px;
  border-radius: 3px;
  width: 250px;
  font-size: 14px;
}

.custom-field .placeholder {
  position: absolute;
  left: 12px;
  top: calc(50% + 10px);
  transform: translateY(-50%);
  color: #aaa ;
  transition: 
      top 0.3s ease-in-out,
      font-size 0.3s ease-in-out,
      color 0.3s ease-in-out;
}

.custom-field input:valid + .placeholder,
.custom-field input:focus + .placeholder {
  top: 10px;
  font-size: 12px;
  color: #aaa;
}

Floating Input Placeholder In Pure CSS, Animation Input Plugin/Github, floating label select dropdown, move placeholder above the input on focus


See Demo And Download

Official Website(fatihhidiroglu): Click Here

This superior jQuery/javascript plugin is developed by fatihhidiroglu. For extra Advanced Usages, please go to the official website.

Related Posts

Responsive-Multiple-Selection-Combo-Box-using-Bootstrap-3

Responsive Multiple Selection Combo Box using Bootstrap 3 | MagicSuggest

MagicSuggest is an easy-to-use jQuery plugin for creating a combo menu that allows you to select multiple items from a dropdown list with typing and auto-complete support….

material-design-tab-vanilla-js

Material Design Inspired Tab UI In Vanilla JavaScript

Material Design tab vanilla JS implements a material design-inspired tab component with a click ripple effect and an active sliding menu cursor. Must Read: Responsive Accessible Tabs…

countdown-timer-app

Simple Countdown Timer App In jQuery

The countdown is a front-end application that allows starting the countdown with two options: set a target date or write the number of countdown days. A countdown…

html5-animate-js

Add Animation to Your HTML5 Pages | animate.js

animate.js is a small JavaScript library that provides a convenient way to apply CSS animations powered by Animate.css to DOM elements without writing any CSS. Easily apply…

vue-responsive-parallax-cards

Responsive Hover Parallax Cards With Vuejs

Vue Responsive Parallax Cards Hover Create response cards with a scroll-triggered parallax effect in your Vue.js application. Must Read: jQuery Sliding Display Your Content Like a Deck…

pure-css-tabs-responsive

Responsive Pure CSS Only Accordion & Tabs Component

Responsive pure CSS accordion tabs and tabs will automatically convert to a vertical accordion interface on mobile devices. Must Read: Create Dynamic Accordion Giving JSON Data Using…