在 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>
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP