HTML中的多行输入框:<textarea>标签、cols属性、rows属性。

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>下拉列表</title>
        <base target="_self">
    </head>
<body>
    <form>
       <textarea cols="3" rows="3">
       </textarea>
    </form>
</body>
</html>


1.默认情况下输入框可以无限换行。

2.默认情况下输入框 有自己的高度和宽度。

3.可以通过cols和设置宽度,通过rows设置高度。虽然设置了高度和宽度,但是依然可以无限的换行(往下输入)。

4.默认情况下输入框是可以手动拉伸,如下图:


  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
代码实现如下: ```html <form> <label for="username">用户名:</label> <input type="text" id="username" name="username"><br> <label for="password">密码:</label> <input type="password" id="password" name="password"><br> <label for="gender">性别:</label> <input type="radio" id="male" name="gender" value="male"> <label for="male">男</label> <input type="radio" id="female" name="gender" value="female"> <label for="female">女</label><br> <label for="interests">兴趣:</label> <input type="checkbox" id="singing" name="interests" value="singing"> <label for="singing">唱歌</label> <input type="checkbox" id="dancing" name="interests" value="dancing"> <label for="dancing">跳舞</label> <input type="checkbox" id="coding" name="interests" value="coding"> <label for="coding">敲代码</label><br> <label for="avatar">头像:</label> <input type="file" id="avatar" name="avatar"><br> <label for="city">城市:</label> <select id="city" name="city"> <option value="">请选择城市</option> <option value="beijing">北京</option> <option value="shanghai">上海</option> <option value="guangzhou">广州</option> </select><br> <label for="introduction">自我介绍:</label><br> <textarea id="introduction" name="introduction" rows="5" cols="30"></textarea><br> <input type="submit" value="提交"> </form> ``` 这段代码实现了一个用户信息表单,其包括了用户名、密码、性别、兴趣、头像、城市和自我介绍等信息。用户名和密码使用了输入框,性别使用了单选按钮,兴趣使用了多选框,头像使用了文件上传框,城市使用了下拉菜单,自我介绍使用了多行文本框。最后还有一个提交按钮。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值