利用CSS改变输入框的光标颜色
转:http://www.cnblogs.com/gymmer/p/6810367.html
代码:
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Document</title> 6 <style type="text/css"> 7 input, 8 textarea { 9 color: #0f0; 10 text-shadow: 0px 0px 0px #000; 11 -webkit-text-fill-color: transparent; 12 } 13 14 input::-webkit-input-placeholder, 15 textarea::-webkit-input-placeholder{ 16 text-shadow: none; 17 -webkit-text-fill-color: initial; 18 } 19 </style> 20 </head> 21 <body> 22 <input type="text" placeholder="test"> 23 <p></p> 24 <textarea name="" cols="30" rows="10"></textarea> 25 </body> 26 </html>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步