提示框中在链接的标签上添加 alert-link 类来设置匹配提示框颜色的链接:
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap4 实例</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" rel="external nofollow" target="_blank" >
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" ></script>
<script src="https://cdn.bootcss.com/popper.js/1.12.5/umd/popper.min.js" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" ></script>
<script src="https://cdn.bootcss.com/bootstrap/4.1.0/js/bootstrap.min.js" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" ></script>
</head>
<body>
<div class="container">
<h2>提示框添加链接</h2>
<p>提示框中在链接的标签上添加 alert-link 类来设置匹配提示框颜色的链接:</p>
<div class="alert alert-success">
<strong>成功!</strong> 你应该认真阅读 <a href="#" class="alert-link">这条信息</a>。
</div>
<div class="alert alert-info">
<strong>信息!</strong> 你应该认真阅读 <a href="#" class="alert-link">这条信息</a>。
</div>
<div class="alert alert-warning">
<strong>警告!</strong> 你应该认真阅读 <a href="#" class="alert-link">这条信息</a>。
</div>
<div class="alert alert-danger">
<strong>错误!</strong> 你应该认真阅读 <a href="#" class="alert-link">这条信息</a>。
</div>
<div class="alert alert-primary">
<strong>首选!</strong> 你应该认真阅读 <a href="#" class="alert-link">这条信息</a>。
</div>
<div class="alert alert-secondary">
<strong>次要的!</strong> 你应该认真阅读 <a href="#" class="alert-link">这条信息</a>。
</div>
<div class="alert alert-dark">
<strong>深灰色!</strong>你应该认真阅读 <a href="#" class="alert-link">这条信息</a>。
</div>
<div class="alert alert-light">
<strong>灰色!</strong> 你应该认真阅读 <a href="#" class="alert-link">这条信息</a>。
</div>
</div>
</body>
</html>
尝试一下 |