1. 程式人生 > >利用CSS改變輸入框的光標顏色

利用CSS改變輸入框的光標顏色

color webkit shadow .html fill clas ans spa ace

轉: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>

利用CSS改變輸入框的光標顏色