HTML cols 属性
htmlweb developmentfront end technology更新于 2025/8/29 5:32:17
HTML 中的 cols 属性可用于
以下是语法 −
<textarea cols="num">
以上,num 是文本区域的宽度。默认值为 20。
现在让我们看一个实现 <textarea> 元素的 cols 属性的示例 −
示例
<!DOCTYPE html> <html> <body> <h2>Interview Questions</h2> <p>Why do you want go for the Editor Job Profile? (100 words)</p> <textarea rows="6" cols="70" autofocus> Write the answer in 100 words only... </textarea> <p>What are your weaknesses? (50 words)</p> <textarea rows="4" cols="70" autofocus> Write the answer in 50 words only... </textarea> </body> </html>
输出

相关文章
有用资源
html 参考教程 - 该教程包含有关 html 的更多信息:https://www.cainiaomax.com/html/

