在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>