<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap 实例</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.2/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.2/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<div class="container mt-3">
<h3>Toast 实例</h3>
<p>Toast 类似警告框,它只在发生某些事情时显示几秒钟(即当用户单击按钮、提交表单等时)。</p>
<p>在本例中,我们使用 .show 类来默认显示 toast。您可以通过单击 toast 标题内的关闭 (x) 图标来关闭它。</p>
<div class="toast show">
<div class="toast-header">
<strong class="me-auto">Toast 标题</strong>
<button type="button" class="btn-close" data-bs-dismiss="toast"></button>
</div>
<div class="toast-body">
<p>toast 主体内的文本。</p>
</div>
</div>
</div>
</body>
</html>