Computer >> คอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

ระบุสีของเคอร์เซอร์ในองค์ประกอบด้วย CSS


หากต้องการกำหนดสีของเคอร์เซอร์ ให้ใช้ CSS caret-color คุณสมบัติ. คุณสามารถลองเรียกใช้รหัสต่อไปนี้เพื่อใช้คุณสมบัติคาเร็ตสี

ตัวอย่าง

<!DOCTYPE html>
<html>
   <head>
      <style>
         .demo {
            caret-color: blue;
          }
      </style>
   </head>
   <body>
      <p>Place the mouse cursor below to see a blue color cursor</p>
      <input class = "demo" value = "Blue Cursor"><br><br>
   </body>
</html>