Html 如何减少文本框的宽度?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1636903/
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 can the textbox width be reduced?
提问by svk
Can I reduce the textbox width without using classes?
我可以在不使用类的情况下减小文本框的宽度吗?
<input type="text" maxlength="5" style="3px"/>
回答by Faruz
<input type="text" style="width:50px;"/>
回答by blagus
Is not nice to define textbox width without using CSS, be warned ;-)
在不使用 CSS 的情况下定义文本框宽度不好,请注意;-)
<input type="text" name="d" value="4" size="4" />
回答by Jeffrey Aylesworth
rows and cols are required attributes, so you should have them whether you really need them or not. They set the number of rows and number of columns respectively.
row 和 cols 是必需的属性,因此无论您是否真的需要它们,都应该拥有它们。他们分别设置行数和列数。
回答by lalit
<input type='text'
name='t1'
id='t1'
maxlength=10
placeholder='typing some text' >
<p></p>
This is the text box, it has a fixed length of 10 characters, and if you can try but this text box does not contain maximum length 10 character
这是文本框,它有固定长度的 10 个字符,如果您可以尝试但此文本框不包含最大长度 10 个字符