防止文本到达textarea的右侧,为垂直滚动条保留空间,当出现文本时不会移动文本 [英] preventing text from reaching the right side of the textarea, reserving space for vertical scroll bar, which will not move the text when appears

查看:162
本文介绍了防止文本到达textarea的右侧,为垂直滚动条保留空间,当出现文本时不会移动文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个textarea,在输入一些文本时,在很多行之后,您会得到一个垂直滚动条,它将文本向左移动一点,因为它需要空间。



如何在textarea的右侧保留滚动条所在的区域,以便在那里不写任何内容?

我试过应用 padding-right to textarea,但它将滚动条本身向左移动。

解决方案

不是一个确切的答案,但你可能想完全滚动条 -
Autosize jQuery


I have a textarea which when typing some text into, after so many line you get a vertical scroll bar which moves text a bit to the left because it needs space for itself.

How can I reserve that area on the right side of textarea where the scroll bar will appear so that nothing will be written there?

I have tried applying padding-right to textarea but it moves the scroll bar itself to the left.

解决方案

Not an exact answer, but you might want to go completely scrollbar-less - Autosize jQuery

这篇关于防止文本到达textarea的右侧,为垂直滚动条保留空间,当出现文本时不会移动文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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