javascript 将 HTML 文本输入光标符号更改为“块”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13214104/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 18:05:47  来源:igfitidea点击:

Change HTML text input cursor symbol to "block"

javascripthtmlcssinputcursor

提问by alt

Possible Duplicate:
How to use this square cursor in a HTML input field?

可能重复:
如何在 HTML 输入字段中使用此方形光标?

Is there a way to change the cursor style of an HTML text <input>'s cursor to the "block" kind like a command prompt?

有没有办法<input>像命令提示符一样将 HTML 文本光标的光标样式更改为“块”类型?

Block cursor

块光标

If not, is there a way to hide the default text cursor then append a block character at the end of the text that cannot be deleted?

如果没有,有没有办法隐藏默认文本光标,然后在无法删除的文本末尾附加一个块字符?

Thanks.

谢谢。

回答by Paul Alex

To hide the cursor you can use : cursor: none;

要隐藏光标,您可以使用: cursor: none;