开发者

Textarea: problem in Opera -- text does not get wrapped onto the next line?

开发者 https://www.devze.com 2023-04-02 02:13 出处:网络
I do not want the scroll bars,hence i\'ve given overflow:hidden. A simple text area: <textarea cols=10 rows=2 styl开发者_StackOverflow中文版e=\'overflow:hidden\' ></textarea>

I do not want the scroll bars,hence i've given overflow:hidden.

A simple text area:

<textarea cols=10 rows=2 styl开发者_StackOverflow中文版e='overflow:hidden' ></textarea>

when opened in Opera Browser -- fails to wrap the entered text onto the next line when the entered text exceeds the column length (Text gets wrapped onto the next line in every other browser -- FF,Chrome,Safari)


from the HTML4 spec:

cols = number [CN] This attribute specifies the visible width in average character widths. Users should be able to enter longer lines than this, so user agents should provide some means to scroll through the contents of the control when the contents extend beyond the visible area. User agents may wrap visible text lines to keep long lines visible without the need for scrolling.

there is no required there that it must wrap.

and from the HTML5 spec:

The cols attribute specifies the expected maximum number of characters per line. If the cols attribute is specified, its value must be a valid non-negative integer greater than zero. If applying the rules for parsing non-negative integers to the attribute's value results in a number greater than zero, then the element's character width is that value; otherwise, it is 20.

The user agent may use the textarea element's character width as a hint to the user as to how many characters the server prefers per line (e.g. for visual user agents by making the width of the control be that many characters). In visual renderings, the user agent should wrap the user's input in the rendering so that each line is no wider than this number of characters.

So maybe there you could be right, although I don't know how strict a "should" is in this definition.

But in both cases it's probably by design.

0

精彩评论

暂无评论...
验证码 换一张
取 消