css3简单实现输入框选中酷炫效果
作者:互联网
<!DOCTYPE HTML> <html> <head> <meta charset=UTF-8 /> <title>Nothing</title> <style type="text/css"> #post{ position: relative; } span{ position: absolute; left: 0.625rem; top: 0; pointer-events: none; transition: all 0.4s; } input:focus + span{ color: palevioletred; transform: scale(0.8); background-color: #fff; padding: 4px; top: -10px; } </style> </head> <body> <div id="post"> <input type="text" id="txt" /> <span>郵箱</span> </div> </body> </html>
标签:css3,0.8,span,color,top,酷炫,输入框,position 来源: https://www.cnblogs.com/liangtang/p/15495294.html