2014-10-02 36 views
0
<textarea style="color:red;"></textarea> 

我有一个textarea设置颜色为红色。不过,我希望闪烁标记为黑色,以便用户可以更清楚地看到他们正在输入的内容。更改textarea blink打印标记的颜色

无论如何要做到这一点?我是否需要使用JavaScript,如果有,请告诉我如何?

enter image description here

+1

http://stackoverflow.com/questions/5615681/how-to-change-cursor-color-without-changing-text-color – j08691 2014-10-02 21:49:55

+0

以任何机会,有你看着[这些](http://stackoverflow.com/questions/7339333/styling-text-input-caret)[类似](http://stackoverflow.com/questions/5615681/how-to-change-cursor -color-without-changing-text-color)[threads](http://stackoverflow.com/questions/20324434/change-textarea-cursor-color-in-the-textarea)? – 2014-10-02 21:50:44

+0

我不认为你可以单独控制它们,但确实告诉你是否找到任何东西。 – dandavis 2014-10-02 22:15:49

回答

0

试试这个 -

textarea { 
cursor: url(cursor.cur); 
} 
-1

实现自定义游标

如果你需要默认情况下不包括光标,或不支持 在所有浏览器,您可以选择包含自定义光标 图像。这可以与font-family规则类似地定义,其中 您在未加载自定义游标的情况下提供回退。

.elementClass { 
    cursor:  url(/cursors/cursor.png), /* Modern */ 
      url(/cursors/cursor.cur), /* IE */ 
      default; /* Built-in fallback */ 
} 

More Info herehere

+0

插入符号,不是游标。不同的东西 – 2015-01-30 14:33:25

+0

哦,我误解了@timeNomad的问题......谢谢 – Hitesh 2015-01-31 09:48:56

+0

@timeNomad - http://english.stackexchange.com/questions/74548/is-caret-a-widely-understood-word – Hitesh 2015-01-31 09:50:18