开发者

HTML : doubt in textarea tag

开发者 https://www.devze.com 2023-03-01 14:59 出处:网络
when a normal HTML <textarea> tag is used, the size of the <textarea> can be altered by the user by clicking on the bottom right corner and dragging it. I n开发者_如何学编程otice this in m

when a normal HTML <textarea> tag is used, the size of the <textarea> can be altered by the user by clicking on the bottom right corner and dragging it. I n开发者_如何学编程otice this in many places including textareas in SO. How can I disable this resizing? Is there any way to do that?


That's a feature provided by the browser rendering engine, not HTML itself. You can override it with CSS:

<textarea style="resize: none;">some text here</textarea>


(For Chrome) you can add some CSS to do this, as shown below:

textarea {
resize: none;
}


Use the resize attribute on the textarea;

textarea {
    resize: none;
}

You can also specify horizontal|vertical|both ad the value.

0

精彩评论

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