Html 如何创建固定大小的 twitter bootstrap 文本区域
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15248804/
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
How to create a fixed size twitter bootstrap text area
提问by Saurabh Kumar
I want to create a fixed sized text area which cannot be dragged to change the size. How can I make a text area fixed size in Twitter Bootstrap
.
How can its size be fixed? By fixed size I mean fixed number of cols and rows.
我想创建一个固定大小的文本区域,它不能被拖动来改变大小。如何在Twitter Bootstrap
. 它的大小如何固定?固定大小是指固定数量的列和行。
I went through the documentationbut didn't get any clue.
我浏览了文档,但没有得到任何线索。
采纳答案by kingdomcreation
You could also set the css style width and min-width so as the height and min-height as well as max-width and max-height. just another suggestion.
您还可以将 css 样式的宽度和最小宽度设置为高度和最小高度以及最大宽度和最大高度。只是另一个建议。
textarea{
width: 200px;
min-width:200px;
max-width:200px;
height:200px;
min-height:200px;
max-height:200px;
}
回答by Oliver
Add this to your CSS:
将此添加到您的 CSS:
textarea { resize:none; }
or this for fixed width (and keep vertical resizing):
或者这对于固定宽度(并保持垂直调整大小):
textarea { resize:vertical; }
Note that this is not supported by opera and internet explorer.
请注意,opera 和 Internet Explorer 不支持此功能。