設定 Bootstrap 按鈕的啟用狀態


為了給 Bootstrap 按鈕設定啟用狀態,使用 .active 類。

按鈕將顯示為按下狀態,如下程式碼所示

示例

線上演示

<!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>
      <p>The following are some buttons:</p>
      <button type = "button" class = "btn btn-default btn-lg ">
         Default Button
      </button>
      <button type = "button" class = "btn btn-default btn-lg active">
         Active Button
      </button>
   </body>
</html>

更新於: 2020 年 6 月 12 日

2K+ 瀏覽

開啟你的 職業生涯

透過完成課程獲得認證

開始學習
廣告
© . All rights reserved.