Bootstrap 表单输入
最常见的表单文本字段是输入字段。在这里,用户将输入大部分必要的表单数据。Bootstrap 为所有本机 HTML5 输入类型提供支持: text、password、datetime、datetime-local、date、month、time、week、number、email、url、search、tel 和 color。要使Inputs 完全呈现样式,需要有正确的type 声明。
你可以尝试运行以下代码,了解如何在 Bootstrap 中使用表单输入
示例
<!DOCTYPE html> <html> <head> <title>Bootstrap Form Input</title> <meta name = "viewport" content="width = device-width, initial-scale = 1"> <link rel = "stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css"> <script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src = "https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> </head> <body> <form role = "form"> <div class = "form-group"> <label for = "name">Player</label> <input type = "text" class = "form-control" placeholder = "Player Name"> </div> <div class = "form-group"> <label for = "name">Rank</label> <input type = "text" class = "form-control" placeholder = "Player Rank"> </div> </form> </body> </html>
广告