Float Label Pattern
How do I make an float label pattern?
Quick implementation of the float label pattern by Matt D Smith featured by Brad Frost. What is a float label pattern? How do you make a float label pattern? This script and codes were developed by Robert on 08 November 2022, Tuesday.
Float Label Pattern - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Float Label Pattern</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="c"> <input id="c" type="text" placeholder="Prename" /> <label for="c">Prename</label>
</div>
<div class="c"> <input id="c" type="text" placeholder="Name" /> <label for="c">Name</label>
</div> <script src="js/index.js"></script>
</body>
</html>
Float Label Pattern - Script Codes CSS Codes
html { font: 16px "Helvetica"; padding: 50px;
}
.c { position: relative; margin-bottom: 10px;
}
label { position: absolute; left: 0; opacity: 0; color: gray; font-size: 0.7em; font-weight: bold; -webkit-transform: translate3d(0, 5px, 0); transition: all 0.3s ease-out;
}
label.active { opacity: 1; -webkit-transform: translate3d(0, 0, 0);
}
input { font: inherit; font-size: inherit; margin: 0; margin-top: 15px; outline: none; border: none; border-bottom: 1px solid #999;
}
input:focus ~ label { color: blue;
}
Float Label Pattern - Script Codes JS Codes
[].forEach.call(document.querySelectorAll('input'), function(el) { var label = el.nextElementSibling; el.addEventListener('keyup', function() { label.classList.toggle('active', this.value); });
});
Developer | Robert |
Username | rendro |
Uploaded | November 08, 2022 |
Rating | 3 |
Size | 2,430 Kb |
Views | 14,168 |
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 |
A Pen by Robert | 3,362 Kb |
Greeting card | 2,208 Kb |
CSS Slideshow | 1,847 Kb |
Subtle overlay | 2,579 Kb |
Easy pie chart admin panel | 3,369 Kb |
CSS3 Browser | 2,882 Kb |
Flexbox slider | 3,459 Kb |
Responsive image grid | 2,345 Kb |
CSS3 Diamond | 1,960 Kb |
CSS vintage filter form images | 2,190 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 |
Twinner Spinner II | Katydecorah | 2,974 Kb |
Border image | JohnRiordan | 2,120 Kb |
Using Flickr API | MoyArt | 6,761 Kb |
Css3 loader | Clknap | 2,391 Kb |
Hexagons | Ashmind | 4,360 Kb |
Wikipedia Viewer | Codinger | 4,681 Kb |
Flex layout example | Mofny | 1,663 Kb |
IbrahimJabbari-Effect21 | Ibrahimjabbari | 1,882 Kb |
RollOver Effect 2 | Lmack90 | 2,162 Kb |
Speech bubbles | Something | 1,547 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!