如何隐藏文本框闪烁光标? [英] How to hide the text box blinking cursor?

查看:689
本文介绍了如何隐藏文本框闪烁光标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在CSS / Javascript中隐藏文本框的闪烁光标。

I need to hide the text box blinking cursor in CSS / Javascript.

是否有可能?

推荐答案

<input type=text disabled="disabled"/>

,因为我看不到任何其他原因。

because i can't see any other reason you might want to do that.

编辑:

我想要允许用户滚动大于该区域,但不显示闪烁?

i guess you want to allow the user to scroll the text that is larger than the area, but not show the blinking?

如果是这样,您仍然要禁用它。不只是隐藏闪烁的光标。如果用户不能在那里键入,应该禁用。

if that is so, you still want to disable it. not just hide the blinking cursor. if the user can't type there, it should be disabled. period.

现在,如果您仍然希望允许用户查看所有内容,则必须将输入设置为与内容一样大。没有逃避。

now, if you still want to allow the user to see all the content, you have to make the input as big as the content. there is no escaping that.

然后用父 div > overflow:hidden 或滚动

and then limit the size with a parent div with CSS overflow: hidden or scroll.

<div style="overflow: scroll-x;"><input size=255 value="some string 255 char long" /></div>

这篇关于如何隐藏文本框闪烁光标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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