1

I have a textarea with overflow-x: auto; attributed to it. It works great when a user is typing text into the box by hand. When a user copy pastes a line from a file, however, that is bigger than my textarea, the overflow-x property does not work, instead the textarea wordwraps the long line.

Is there a way (maybe javascript) to make overflow-x work on copy-paste?

Thanks.

4

2 回答 2

2

我不确定您要实现什么 - 当用户输入文本时文本区域会自动扩展吗?我无法仅使用 HTML 和 CSS 创建这样的行为。

理论上,您可以将 textarea wrap 属性设置为“no”,这将在用户输入或粘贴长行时强制创建水平滚动条。

于 2009-09-04T17:59:17.850 回答
0

From the looks of it, it would seem that the text comes pre-wordwrapped from the editor. What editor are you using, and on which platform are you experiencing this behaviour?

于 2008-10-02T16:41:43.377 回答