<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>提示框动画</title>
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.1.0/css/bootstrap.min.css">
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/popper.js/1.12.5/umd/popper.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>提示框动画,点击X会消失</h2>
<!-- .fade(淡出)和.show 类用于设置提示框在关闭时的淡出淡入效果
-->
<!-- 可以在提示框中的div中添加.alert-dismissable类,然后在关闭按钮的链接上添加class="close
和data-dismiss="alert"类来设置提示框的关闭操作-->
<div class="alert alert-success alert-dismissable fade show">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>成功!</strong> 指定操作成功提示信息。
</div>
</div>
</body>
</html>
效果展示