bootstrap表单示例代码分享

<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta content="width=device-width, initial-scale=1, user-scalable=no"> <title>表单和图片</title> <link href="https://www.jb51.net/lib/bootstrap/css/bootstrap.css" > <link href="https://www.jb51.net/css/main.css" > <!--[if lt IE 9]> <script src="https://www.jb51.net/lib/html5shiv/html5shiv.min.js"></script> <script src="https://www.jb51.net/lib/respond/respond.min.js"></script> <![endif]--> </head> <body> <form> <label>用户名:</label> <input type="text" placeholder="请输入用户名"> <label>密码:</label> <input type="password" placeholder="请输入密码"> </form> <form> <label>用户名:</label> <input type="text" placeholder="请输入用户名"> <label>密码:</label> <input type="password" placeholder="请输入密码"> </form> <!--基本表单--> <form> <div> <label>用户名:</label> <input type="text" placeholder="请输入用户名"> </div> <div> <label>密码:</label> <input type="password" placeholder="请输入密码"> </div> </form> <!--内联表单--> <form><!--当屏幕小于768时,变为两行--> <div> <label>用户名:</label> <input type="text" placeholder="请输入用户名"> </div> <div> <label>密码:</label> <input type="password" placeholder="请输入密码"> </div> </form> <!--加入input-group-addon--> <form> <div> <label>用户名:</label> <input type="text" placeholder="请输入用户名"> </div> <div> <label>密码:</label> <input type="password" placeholder="请输入密码"> </div> <div> <div>¥</div> <input type="number" placeholder="请输入整数"> <div>元</div> </div> </form> <!--水平表单--> <form><!--当屏幕小于768时,变为两行--> <div> <div> <label>用户名:</label> </div> <div> <input type="text" placeholder="请输入用户名"> </div> </div> <div> <div> <label>密码:</label> </div> <div> <input type="password" placeholder="请输入密码"> </div> </div> </form> <!--文本域--> <form> <textarea rows="3"></textarea> </form> <form> <div> <label>文本域</label> <textarea rows="3"></textarea> </div> </form> <!--复选框--> <form> <input type="checkbox">体育 <input type="checkbox">音乐 <label> <input type="checkbox">体育 </label> <label> <input type="checkbox">音乐 </label> <!--基本复选框和复选框设置禁用--> <div> <label> <input type="checkbox">体育 </label> </div> <div> <label> <input type="checkbox">音乐 </label> </div> <div> <label> <input type="checkbox" disabled>爱好 </label> </div> <!--内联复选框--><!--复选框用法和单选框一样的--> <label> <input type="checkbox">体育 </label> <label> <input type="checkbox">音乐 </label> <label> <input type="checkbox" disabled>爱好 </label> </form> <!--下拉框--> <form> <select> <option>1</option> <option>2</option> <option>3</option> <option>4</option> </select> <select> <option>1</option> <option>2</option> <option>3</option> <option>4</option> </select> </form> <!--校验状态--> <form> <div> <label>用户名:</label> <input type="text" placeholder="请输入用户名"> <span></span> </div> <div> <label>密码:</label> <input type="password" placeholder="请输入密码"> </div> </form> <script src="https://www.jb51.net/lib/jquery/jquery.js"></script> <script src="https://www.jb51.net/lib/bootstrap/js/bootstrap.js"></script> <script src="https://www.jb51.net/js/main.js"></script> </body> </html>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wysgxz.html