在 Bootstrap 中创建一个指示警告的黄色警告框
bootstrapweb developmentcss framework更新于 2026/2/14 2:20:17
要创建一个指示警告操作的黄色警告框,请使用 alert-warning 类。
要实现 alert-warning 类,您需要尝试运行以下代码
示例
<!DOCTYPE html> <html> <head> <title>Bootstrap Example</title> <link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css"> <script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src = "https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> </head> <body> <div class = "alert alert-info"> <p>Indicates a positive action!</p> </div> <div class = "alert alert-warning"> <p>Indicates warning!</p> </div> </body> </html>

