文本域与原始使用方法相同,设置rows可定义其高度,设置cols可以设置其宽度。但如果textarea元素中添加了类名“form-control”类名,则无需设置cols属性。因为Bootstrap框架中的“form-control”样式的表单控件宽度为100%或auto。
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>表单控件——下拉选择框select元素</title> <link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> </head> <body> <form role="form"> <div class="form-group"> <textarea class="form-control" rows="3"></textarea> </div> </form> </body> </html>
评论前必须登录!
注册