透過 Bootstrap 在水平佈局中對標籤和窗體控制元件組進行對齊
在 Bootstrap 中使用 .form-horizontal 類以在水平佈局中對齊標籤和窗體控制元件組。
你可以嘗試執行以下程式碼來實現 .form-horizontal 類
示例
<!DOCTYPE html> <html> <head> <title>Bootstrap Example</title> <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet"> <script src = "/scripts/jquery.min.js"></script> <script src = "/bootstrap/js/bootstrap.min.js"></script> </head> <body> <form class = "form-horizontal" role = "form"> <div class = "form-group"> <label class = "sr-only" for = "name">Name</label> <input type = "text" class = "form-control" id = "name" placeholder = "Enter Name"> </div> <div class = "form-group"> <label class = "sr-only" for = "name">Name</label> <input type = "number" class = "form-control" id = "name" placeholder = "Enter Age"> </div> <button type = "submit" class = "btn btn-primary">Submit</button> </form> </body> </html>
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 語言程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP