Html 如何禁用 <textarea> 的调整大小抓取器?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5271782/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 07:16:57  来源:igfitidea点击:

How to disable the resize grabber of <textarea>?

htmlcssforms

提问by Hyman Billy

How to disable the grabber in the <textarea>?

如何在<textarea>?

I mean that triangle thing which appears in the right-bottom corner of the <textarea>.

我的意思是出现在<textarea>.

回答by anothershrubery

Just use resize: none

只需使用 resize: none

textarea {
   resize: none;
}

You can also decide to resize your textareas only horizontal or vertical, this way:

您还可以决定仅水平或垂直调整文本区域的大小,如下所示:

textarea { resize: vertical; }

textarea { resize: vertical; }

textarea { resize: horizontal; }

textarea { resize: horizontal; }

Finally, resize: bothenables the resize grabber.

最后, resize: both启用调整大小抓取器。

回答by Tom

<textarea style="resize:none" name="name" cols="num" rows="num"></textarea>

Just an example

只是一个例子

回答by mikk mikk

example of textarea for disable the resize option

禁用调整大小选项的 textarea 示例

<textarea CLASS="foo"></textarea>

<style>
textarea.foo
{
resize:none;
}

</style>