HTML 多行文本输入:使用 textarea 元素
在 HTML 中,可以使用 <textarea> 元素来实现多行文本输入。该元素允许用户输入多行文本。
以下是一个示例:
<textarea rows='4' cols='50'>
在这里输入多行文本...
</textarea>
在上面的示例中,rows 属性指定了文本区域的行数,cols 属性指定了文本区域的列数。用户可以在 <textarea> 标签中输入多行文本。
还可以使用 CSS 来样式化 textarea 元素,例如设置宽度、高度、边框等样式。
<textarea style='width: 300px; height: 100px; border: 1px solid black;'>
在这里输入多行文本...
</textarea>
使用 textarea 元素,可以方便地实现多行输入。
原文地址: https://www.cveoy.top/t/topic/qlAG 著作权归作者所有。请勿转载和采集!