在 Bootstrap 中建立可撤銷告警


要建立可撤銷告警,請執行以下操作:

  • 透過建立一個包裝 <<div> 並新增 .alert 的類以及四個上下文類之一(例如,.alert-success、.alert-info 等),新增基本告警。
  • 另外,向以上 <div> 類新增可選的 .alert-dismissable。
  • 新增一個關閉按鈕。

你可以嘗試執行以下程式碼來建立可撤銷告警:

示例

即時演示

<!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 = "alert alert-success alert-dismissable">
         <button type = "button" class = "close" data-dismiss = "alert" aria-hidden = "true">
            ×
         </button>
         Success! Well done its submitted.
      </div>
      <div class = "alert alert-info alert-dismissable">
         <button type = "button" class = "close" data-dismiss = "alert" aria-hidden = "true">
            ×
         </button>
         Info! Take this info.
      </div>
   </body>
</html>

更新於:12-Jun-2020

321 次瀏覽

啟動你的職業生涯

完成課程,獲得認證

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