0

Basically what I'm trying to do is 'hide' the resize handle on a Struts2 Textarea. But with my attempt at it I had and unexpected result. With my code I told it to overflow in the x & y direction with a scrollbar then I told the resize to be 'none'

I expected the resize handle to disappear which it did but the overflow is just wrapping down to the next line instead of scrolling.

<s:textarea name="newsString" cols="65" rows="17" style="overflow: scroll; resize: none;"></s:textarea>

So how should I properly go about hiding the resize handle and still having it scroll? If that is at all possible.

4

1 回答 1

2

在 Struts2 标签中,class属性style被命名cssClasscssStyle.

这将起作用:

<s:textarea name="newsString" cols="65" rows="17" 
            cssStyle="overflow: scroll; resize: none;" />

由于不存在的属性,您没有收到编译错误的事实是因为<s:textarea>标签(如<s:file>标签,也许还有其他一些),有

允许的动态属性:true

如官方文档中指定的那样),这意味着您将编写的所有内容(不是有效的 Struts2 属性)将在 HTML 中报告而无需任何解析(因此,例如,当CSS3-4细节HTML5引入新功能时,没有需要更改标签以保持最新状态,让我们考虑<s:file />...中的 multiple="multiple" 属性)

于 2013-07-23T22:04:23.330 回答