如何用css修改插入符号 [英] How to modify the caret with css

查看:164
本文介绍了如何用css修改插入符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用CSS来改变光标(文本插入点,文本插入游标,文本框中闪烁的东西)从正常的垂直条到块,像大多数命令中默认的种类

input-caret>这里



我相信这是浏览器设计的一部分,而不是css的掌握。



然而,这里有一个有趣的写作,模拟使用Javascript和CSS的克拉改变 http://www.dynamicdrive.com/forums/showthread.php?t=17450 看起来有点怪我,但可能是完成任务的唯一方法。文章的要点是:




textarea在屏幕中的某处在观察者的视图中,当用户点击我们的假终端时,我们将关注于文本区域,当用户开始键入时,我们将简单地将键入到textarea中的数据附加到我们的终端就是这样。


HERE 是一个演示演示


Is there a way to use CSS to change the caret (text insertion point, text insertion cursor, that flashing thing that is in text boxes) from the normal vertical bar to a block, like the kind that is default in most command lines?

解决方案

As answered here:

"I do believe that it is part of the browsers design, and not within the grasp of css.

However, here is an interesting write up on simulating a carat change using Javascript and CSS http://www.dynamicdrive.com/forums/showthread.php?t=17450 It seems a bit hacky to me, but probably the only way to accomplish the task. The main point of the article is:

We will have a plain textarea somewhere in the screen out of the view of the viewer and when the user clicks on our "fake terminal" we will focus into the textarea and when the user starts typing we will simply append the data typed into the textarea to our "terminal" and that's that."

HERE is a demo in action"

这篇关于如何用css修改插入符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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