尝试一下
label {
display: block;
margin-top: 1rem;
}
示例
通过在某些输入类型上添加 size 可以控制输入的宽度。在选择项上添加 size 会改变高度,从而定义在关闭状态下有多少选项是可见的。
html
规范
Specification
HTML# attr-select-size
HTML# attr-input-size
浏览器兼容性
html.elements.select.size
Loading…
html.elements.input.size
Loading…
参见
maxlength
minlength
pattern
Help improve MDN
Was this page helpful to you?
Yes
No
Learn how to contribute
This page was last modified on 2025年8月6日 by MDN contributors.
View this page on GitHub • Report a problem with this content