Bootstrap输入框组件的使用方法,具体内容如下
.input-group——设置div为输入框组;
.input-group-lg、.input-group-sm、.input-group-xs——改变输入框组的尺寸;
.input-group-addon——在输入框前或后加入额外内容;
.input-group-btn——在输入框前或后加入button或button式下拉菜单组件。
代码:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta content="width=device-width,initial-scale=1"> <title>组件_输入框组</title> <link href="https://www.jb51.net/bootstrap.min.css" type="text/css"> <!--<link href="https://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">--> <script src="https://www.jb51.net/jquery-1.11.1.min.js"></script> <script src="https://www.jb51.net/bootstrap.min.js"></script> </head> <body> <div> <p> <div> <span>$</span> <input type="number"/> <span>.00</span> </div> </p> <p> <div> <span>$</span> <input type="number"/> <span>.00</span> </div> </p> <p> <div> <div> <div> <span> <input type="checkbox"/> </span> <input type="text"/> </div> </div> <div> <div> <input type="text" placeholder="马上查询"/> <span> <button type="button" >Go!</button> </span> </div> </div> <div> <div> <div> <button data-toggle="dropdown"> 产品分类 <span></span> </button> <ul role="menu"> <li><a href="#" role="menuitem">男装</a></li> <li><a href="#" role="menuitem">女装</a></li> <li><a href="#" role="menuitem">童装</a></li> </ul> </div> <input type="text" placeholder="清凉一夏"> </div> </div> </div> </p> </div> </body> </html>
效果: