設定 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.