Bootstrap 警報類


建立一個 wrapper <div>,並新增一個 .alert 類和四個上下文類之一(例如,.alert-success、.alert-info、.alert-warning、.alert-danger),即可新增一個基本警報。

你可以嘗試執行以下程式碼來建立一個警報類 −

示例

現場演示

<!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">
         This is Success!
      </div>
      <div class = "alert alert-info">
         This is Info!
      </div>
      <div class = "alert alert-warning">
         This is Warning!
      </div>
      <div class = "alert alert-danger">
         This is Error!
      </div>
   </body>
</html>

更新於:2020-06-12

169 瀏覽量

開啟你的職業生涯

透過完成課程獲得認證

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