使用 Bootstrap 使多個複選框顯示在同一直線上


使用 Bootstrap 中的 .checkbox-line 類可使多個複選框顯示在同一直線上

示例

實際演示

<!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>
      <div class = "container">
         <h2>Programming Survey</h2>
         <p>Which programming languages do you like?</p>
         <form>
            <label class = "checkbox-inline">
               <input type = "checkbox" value = "">Java
            </label>
            <label class = "checkbox-inline">
               <input type="checkbox" value="">C++
            </label>
            <label class = "checkbox-inline">
               <input type = "checkbox" value = "">C
            </label>
         </form>
      </div>
   </body>
</html>

更新於: 2020 年 6 月 12 日

3K+ 次瀏覽

啟動你的 職業

完成課程後獲得認證

立即開始
廣告
© . All rights reserved.