有什么方法可以改变文本区域光标的颜色而不改变字体颜色吗? [英] Is there any way to change JUST the color of the textarea cursor without changing the font color?

查看:140
本文介绍了有什么方法可以改变文本区域光标的颜色而不改变字体颜色吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我的网站提供一个功能,允许用户标记其他用户/文章.但是,文本区域内不支持锚标记.因此,我将文本区域的背景设置为透明,并在其下方放置了一个div.在keyup事件上,div中填充了textarea的值.唯一的问题是,由于光标是透明的,因此用户看不到它.有什么想法吗?

I want to have a function for my website that lets users tag other users/articles. But, anchor tags are not supported inside textareas. So, I set the background to transparent for the textarea and places a div beneath it. On the keyup event, the div is populated with the value of the textarea. The only problem is that the user can't see the cursor since it's transparent. Any ideas?

推荐答案

您可以通过CSS执行此操作... 检查链接 http://beradrian.wordpress.com /2008/01/08/cross-browser-custom-css-cursors/

You can do this via CSS... check the link http://beradrian.wordpress.com/2008/01/08/cross-browser-custom-css-cursors/

input, textarea {
    cursor: url(cursor.cur);
}

这篇关于有什么方法可以改变文本区域光标的颜色而不改变字体颜色吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆