当前阅读教程:Bootstrap4教程 > Bootstrap Input | |
阅读(22555525) 收藏 赞(5685) 分享 | |
上一篇: Bootstrap4 表单控件 | 下一篇: Bootstrap textarea |
Bootstrap 支持所有的 HTML5 输入类型: text, password, datetime, datetime-local, date, month, time, week, number, email, url, search, tel, 以及 color。 注意:: 如果 input 的 type 属性未正确声明,输入框的样式将不会显示。 以下实例使用两个 input 元素,一个是 text,一个是 password : 实例 <div> <label for="usr">用户名:</label> <input type="text" id="usr"> </div> <div> <label for="pwd">密码:</label> <input type="password" id="pwd"> </div> 完整代码 <!DOCTYPE html> <html> <head> <title>Bootstrap 实例(小白教程网 2d5.net)</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css"> <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script> <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script> </head> <body> <div> <h2>表单控件: input</h2> <p>以下实例使用两个 input 元素,一个是 text,一个是 password :</p> <form> <div> <label for="usr">用户名:</label> <input type="text" id="usr"> </div> <div> <label for="pwd">密码:</label> <input type="password" id="pwd"> </div> </form> </div> </body> </html> 效果图 |
|
上一篇: Bootstrap4 表单控件 | 下一篇: Bootstrap textarea |