Textarea中的线高与光标高度问题 [英] line-height vs cursor height issue in Textarea in chrome

查看:642
本文介绍了Textarea中的线高与光标高度问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我们指定line-height大于font-size,我们可以减少与font-height相同的光标高度。请查看此小提琴在Chrome浏览器中,你会得到我在说什么。这工作正常在Firefox,问题只有在Chrome浏览器。
Textarea html is:

Can we reduce cursor height same as font-height if we specify line-height greater than font-size. Have a look at this fiddle in Chrome browser and you will get what I am talking about. This works fine in Firefox, issue is only in Chrome browser. Textarea html is :

<TEXTAREA style="font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 50px; height: 150px;"></TEXTAREA>

编辑:

推荐答案

它的行高度之间的空间,因为我有textarea的背景图像,我在其上放置文本的水平线。听起来好像你想改变位于文本区域内的插入符号。这是一篇涵盖此内容的帖子。

It sounds as if you want to change the Caret located inside the text area. Here's a post that covers this.

样式文本输入插入符

这篇关于Textarea中的线高与光标高度问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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