停用 Bootstrap 列表組中的列表項


在 Bootstrap 列表組中使用 .disabled 類可停用列表中的一個列表項。

可嘗試執行以下程式碼停用一個列表項:

示例

實戰演示

<!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>Beverages</h2>
         <div class = "list-group">
            <a href = "#" class = "list-group-item">Gatorade</a>
            <a href = "#" class = "list-group-item">Coca Cola</a>
            <a href = "#" class = "list-group-item">Pepsi</a>
            <a href = "#" class =" list-group-item disabled">Sting</a>
         </div>
      </div>
   </body>
</html>

更新於: 2020 年 6 月 12 日

1K+ 瀏覽次數

開啟你的 職業

完成課程獲得認證

開始
廣告
© . All rights reserved.