Floating Labels Form
How do I make an floating labels form?
On focus labels animate above fields. required fields are noted by a blinking asterisk.. What is a floating labels form? How do you make a floating labels form? This script and codes were developed by Nicholas M. Smith on 27 August 2022, Saturday.
Floating Labels Form - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Floating Labels Form</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body>
<link href='https://fonts.googleapis.com/css?family=Josefin+Sans|Carrois+Gothic+SC|Metrophobic' rel='stylesheet' type='text/css'>
<h1>Form Floating Labels</h1>
<div class="container"> <form action="#"> <div> <input id="name" name="name" type="text" required> <label class="required" for="name">Name</label> </div> <div> <input id="email" name="email" type="email" required> <label class="required" for="email">Email</label> </div> <div> <textarea id="message" name="phone" required></textarea> <label for="message">Message</label> </div> <input type="submit" value="Send!"> <p class="footnote">* Required Fields</p> </form>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
</body>
</html>
Floating Labels Form - Script Codes CSS Codes
* { box-sizing: border-box;
}
body { background: #f17f5b; font-family: 'Josefin Sans', sans-serif;
}
h1 { color: white; font-size: 3em; font-weight: 100; padding-bottom: 50px; text-align: center;
}
.footnote { color: white; font-size: 0.8em;
}
.container { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; height: 400px; width: 100%;
}
form { width: 50%; min-width: 400px; max-width: 400px; padding: 0 0 30px 0;
}
div { position: relative; padding: 15px 0;
}
label { color: #999; cursor: text; font-size: 1.5em; position: absolute; top: 27px; left: 10px; -webkit-transition: all 0.15s linear; transition: all 0.15s linear;
}
input, textarea { border: none; font-size: 1.5em; outline: none; overflow: hidden; padding: 10px; width: 100%; z-index: 1;
}
input:valid, textarea:valid { background: white;
}
input:valid + label, textarea:valid + label { color: white; font-size: 1em; top: -5px; left: 0;
}
textarea { height: 250px;
}
input:focus + label,
textarea:focus + label { -webkit-animation: animateLabels 1s forwards; animation: animateLabels 1s forwards; color: white; font-size: 1em; top: -5px; left: 0;
}
.required:after { color: white; content: "*"; padding-left: 3px;
}
input:focus + .required:after { color: white; content: "*"; padding-left: 3px;
}
input[type="submit"] { float: right; padding-bottom: 8px; width: 200px;
}
@-webkit-keyframes animateLabels { 0% { opacity: 0; left: 0; top: -10px; } 100% { opacity: 1; left: 0; top: -5px; }
}
@keyframes animateLabels { 0% { opacity: 0; left: 0; top: -10px; } 100% { opacity: 1; left: 0; top: -5px; }
}
Developer | Nicholas M. Smith |
Username | icutpeople |
Uploaded | August 27, 2022 |
Rating | 3.5 |
Size | 3,113 Kb |
Views | 40,480 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Flexbox Test | 2,486 Kb |
Animated Image Hovers | 3,687 Kb |
HTML5 Video Text Overlay Flexbox | 3,024 Kb |
Responsive 3D Flip Navigation | 4,402 Kb |
Blur Image Hovers | 4,013 Kb |
Social Icon Hover Boxes | 2,790 Kb |
Tooltip | 3,142 Kb |
Wordpress 3.8 loader | 2,083 Kb |
Mobile First Responsive Table | 4,026 Kb |
ReactJS Filter | 5,122 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Brent Burns Tribute Page | Nevada48 | 2,569 Kb |
Scoreboard.js basic usage | Tbleckert | 1,733 Kb |
Custom Select Element | Agrayson | 3,616 Kb |
Gears | Synvox | 3,278 Kb |
Vertical drag to change | Plasm | 4,488 Kb |
SlideDown FixedMenu | Mp_graphic | 5,602 Kb |
IE flex collapse bug fix | Rowno | 2,678 Kb |
Sketchy Box | Mnicpt | 3,033 Kb |
Tab Menus | Zephyr | 3,180 Kb |
CSS Grid Test | Ajaykarwal | 2,377 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!