纯CSS3实现漂亮的input输入框动画样式库(Text input love)

2020-05-16 07:14:32易采站长站整理

分享一个用纯 CSS3 实现的,漂亮的 input 输入框动画样式库-Text input love。

点击每个输入框都用不同的动画效果,始终显示标签label,并显示 placeholder(占位符)文本。

演示地址:https://codepen.io/MichaelArestad/full/ohLIa

HTML 代码:


<div class="row">
<p>Click every input.</p>
</div>
<div class="row">
<span>
<input class="basic-slide" id="name" type="text" placeholder="Your best name" /><label for="name">Name</label>
</span>
<span>
<input class="basic-slide" id="email" type="text" placeholder="Your favorite email" /><label for="email">Email</label>
</span>
<span>
<input class="basic-slide" id="phone" type="text" placeholder="You can trust us" /><label for="phone">Phone</label>
</span>
</div>
<div class="row">
<span>
<input class="clean-slide" id="age" type="text" placeholder="Go for the high score!" /><label for="age">Age</label>
</span>
<span>
<input class="clean-slide" id="height" type="text" placeholder="Heels count" /><label for="height">Height</label>
</span>
<span>
<input class="clean-slide" id="weight" type="text" placeholder="Go ahead and lie" /><label for="weight">Weight</label>
</span>
</div>
<div class="row">
<span>
<input class="gate" id="class" type="text" placeholder="Wizard!" /><label for="class">Class</label>
</span>
<span>
<input class="gate" id="element" type="text" placeholder="Five to choose from" /><label for="element">Element</label>
</span>
<span>
<input class="gate" id="move" type="text" placeholder="Secret book attack!" /><label for="move">Move</label>
</span>
</div>
<div class="row">
<span>
<input class="skinny" id="english" type="text" placeholder="Do you speak it?" /><label for="english">English</label>
</span>
<span>
<input class="skinny" id="burger" type="text" placeholder="A Royale with cheese?" /><label for="burger">Burger</label>