How can I create a customized placeholder effect for the Paytm login page text box?

Looking to create a placeholder effect on the text boxes for a Paytm login page?

https://i.sstatic.net/sox0a.png

Answer №1

This effect is achieved solely through the use of CSS3 transitions.

For more information, please refer to this article: http://www.cssscript.com/pure...put-placeholder/

HTML CODE:

<input placeholder="Username" type="text" required>
<input placeholder="Password" type="password" required>

CSS3:

input {
 margin: 40px 25px;
 width: 200px;
 display: block;
 border: none;
 padding: 10px 0;
 border-bottom: solid 1px #1abc9c;
 -webkit-transition: all 0.3s cubic-bezier(0.64, 0.09, 0.08, 1);
 transition: all 0.3s cubic-bezier(0.64, 0.09, 0.08, 1);
 background: -webkit-linear-gradient(top, rgba(255, 255, 255, 0) 96%, #1abc9c 4%);
 background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 96%, #1abc9c 4%);
 background-position: -200px 0;
 background-size: 200px 100%;
 background-repeat: no-repeat;
 color: #0e6252;
}

input:focus,
  input:valid {
  box-shadow: none;
  outline: none;
  background-position: 0 0;
}

input::-webkit-input-placeholder {
  font-family: 'roboto', sans-serif;
  -webkit-transition: all 0.3s ease-in-out;
  transition: all 0.3s ease-in-out;
}

input:focus::-webkit-input-placeholder,
  input:valid::-webkit-input-placeholder {
  color: #1abc9c;
  font-size: 11px;
  -webkit-transform: translateY(-20px);
  transform: translateY(-20px);
  visibility: visible !important;
}

Check out the Live Demo on JSFiddle

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Issue with SwiperJS not completely filling the height of a div

My issue relates to using swiperJS with multiple images, as I'm struggling to make it take the full width and height of the containing div. Despite applying styling like this to my images: .swiper-slide img { width: 100%; height: 1 ...

Generating Placeholder Variables Within a v-for Iteration

Encountering a problem with Vue-JS involving v-for loops and v-model properties. I have an array of items: <input v-for="i in list" v-model="i.model" ... (other tags that use i) > </input> Accompanied by some JavaScr ...

Using next.js to fetch data can result in an endless loop of API

This specific code snippet is taken from the Next.js documentation and can also be accessed through the following link: https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating. However, when attempting to fetc ...

The reflight response received an unexpected HTTP status code of 500

Recently, I've been working on utilizing the Yelp Fusion API by making a simple ajax call. I started off by using the client_id and client_secret provided by Yelp to successfully obtain an access token through a 'POST' request in Postman, fo ...

Unable to achieve successful HTML file upload using jQuery/Ajax

I've been attempting to integrate code from Stack user DannYo's comment here into my project. However, when I run my version of the code, I keep encountering errors with the "beforesend" functions not working properly. HTML <form action="" m ...

Monitor the incoming POST request

Is there a way to monitor incoming post requests in a form? I have the following form: <form method='post'> <input type='text' name'test' /> <input type='submit' name'submit' /> </for ...

The outcome of the JSON response is that the property 'fillColor' cannot be defined in ChartJS

UPDATE Currently, I am only able to view the image linked below: https://i.stack.imgur.com/hkkeY.jpg UPDATE END This piece of PHP code fetches multiple rows from a MySQL database and encodes the result using json_encode. This allows us to retrieve it i ...

What is the mechanism through which createStore fetches the initialState from the reducer function in redux?

While analyzing the code of redux in createStore.js, I am having trouble understanding how it retrieves the initial state from the reducer function when it is specified as the 1st argument. https://github.com/reduxjs/redux/blob/master/src/createStore.js#L ...

What is the best way to adjust the size of an image using PHP code?

I am currently testing a php script with ajax that is responsible for uploading an array of images from this specified source. Although it is functioning well, I am now attempting to incorporate php code that will resize the images to 120px by width or he ...

Issue with Vue-Validator form validation not functioning properly on JS Fiddle

I'm having trouble with vue-validator on JSFiddle. Can someone please assist in troubleshooting the issue so I can proceed with my main question? Check out JSFiddle Html: <div id="app"> <validator name="instanceForm"> & ...

What is the best way to modify the glyphicon within the anchor tag of my AJAX render property?

Consider the use of Ajax: "target 0" with a render option for an anchor tag. Initially, I am utilizing the class "glyphicon glyphicon-chevron-right". Now, I wish to change it to "glyphicon glyphicon-chevron-down" when clicked. $(document).ready(funct ...

How to incorporate a node module into an AngularJS project

Is there a way to import a module like pikaday from another module, such as handsontable, in an angularjs project directly from the node_modules folder? import {pikaday} from handsontable I've tried this approach but it doesn't appear to be wor ...

The dimensions of the HTML table have expanded excessively following the execution of mysql_fetch_assoc

I have encountered an issue where, after inserting the database values into an HTML table, the table becomes too large. I've tried using CSS code to adjust it, but it doesn't help. Should I consider changing something in the database value type? ...

Reset the form upon submission in AngularJS

Hey, I'm looking to reset the form values after a successful submission. How can I achieve this? <div ng-controller="employeelistController as listControl"> <div class="container form-group" ng-controller="addEmployee as addemp"> ...

Using browser's local storage: deleting an entry

I recently came across a straightforward to-do list. Although the inputs are properly stored in local storage, I encountered issues with the "removing item" functionality in JS. Even after removing items from the HTML, they still persist in local storage u ...

Node Js issue stemming from unaddressed promises leading to rejection

Hi, everyone! I'm currently facing some challenges while trying to deploy this API. The error message I keep getting is: "UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error may have occurred due to either throwing inside an asyn ...

Enhance numerous animated shapes in Three.js

Just dipping my toes into the world of Three.js and tinkering with it for fun. My goal is to create a simple dynamic full-screen background for a webpage. You can check out the example here: function createHexagon( vertices, color ) { var geometry = n ...

How to Set Up Bower in WebStorm

I require assistance with the installation process of bower in WebStorm. My current version is 11.0.2 and I have a package.json file that needs to include bower.json for implementing a date-picker in Angular.js. To achieve this, I need to install bower. Th ...

"Material-UI enhanced React date picker for a modern and user-friendly

Currently, I am utilizing the Date picker feature from Material UI. The code snippet responsible for implementing it is as follows: import { DatePicker } from 'redux-form-material-ui'; <Field name="birthDate" ...

Guidelines on populating a Vue array with data fetched from an Axios request

The v-breadcrumbs component is used to display data from the breadcrumbs array, which works seamlessly with static data. <v-row> <!-- Breadcrumbs --> <v-col class="d-flex"> <v-breadcrumbs :items="breadcrumbs"></v ...