垂直表单(默认)
内联表单
水平表单
小妞妞做的表单实例:
<!DOCTYPE html> <html> <head> <title>Bootstrap 教学意见调查表</title> <meta charset="utf-8"> <link href="https://www.jb51.net/css/bootstrap.min.css" > <style> body { padding-top: 150px; padding-bottom: 40px; background-color: #D0E9C6; font-family: '楷体'; font-size: 22px; } .col-sm-2 control-label.form-control{ position: relative; height: 60px; -moz-box-sizing: border-box; box-sizing: border-box; } .form-horizontal{ max-width:800px; padding: 15px; margin: 0 auto; } </style> </head> <body> <div> <form role="form" action="#" method="post"> <div> <label for="name">名字</label> <div> <input type="text" placeholder="请输入名字"> </div> </div> <div> <label for="class">班级</label> <div> <input type="text" placeholder="请输入班级"> </div> </div> <div> <label for="Student ID">学号</label> <div> <input type="text" placeholder="请输入学号"> </div> </div> <div> <label for="kemu">科目名称</label> <div> <input type="text" placeholder="请输入科目名称"> </div> </div> <div> <label for="name2">意见</label> <div> <input type="text" rows="3"> </div> </div> <div> <input type="submit" value="提交" /> <input type="button" value="取消" /> </div> </form> </div> <script src="https://www.jb51.net/js/jquery.min.js"></script> <script src="https://www.jb51.net/js/bootstrap.min.js"></script> </body> </html>
效果图: