你可以这样
HTML:
<div> <input type="text" /> <span >Your email address</span></div>
CSS:
input:focus ~ .floating-label,input:not(:focus):valid ~ .floating-label{ top: 8px; bottom: 10px; left: 20px; font-size: 11px; opacity: 1;}.inputText { font-size: 14px; width: 200px; height: 35px;}.floating-label { position: absolute; pointer-events: none; left: 20px; top: 18px; transition: 0.2s ease all;}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)