如何使用CSS控制光标/插入符号大小 [英] How to control cursor/caret size with CSS
本文介绍了如何使用CSS控制光标/插入符号大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图控制html textarea中的插入符号大小。大小似乎默认为行高,是否有手动控制它的方法?
I'm trying to control the caret size in a html textarea. The size seems to default to the line height, is there a way to manually control it?
推荐答案
没有任何方法以改变插入符在文本区中的外观。如果你想这样做,你将不得不使用textarea以外的东西,如div或canvas元素,并用JavaScript控制一切。
There isn't any way to change how the caret looks in a textarea. If you want to do that, you'll have to use something other than a textarea, such as a div or a canvas element and control everything with JavaScript.
还可以使用 Ace (Mozilla的Bespin项目)组件,这是非常可自定义的。
You can also use the Ace (Mozilla's Bespin project) component instead, which is very customizable.
这篇关于如何使用CSS控制光标/插入符号大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文