6.7.3 关闭按钮和三角箭头

6.7.3 关闭按钮和三角箭头

  • 关闭按钮:通过为<button>设置.close样式,可以将该按钮设为关闭按钮,该关闭按钮总是位于所在容器的右上角
  • 三角箭头:通过为空的<span>设置.caret样式,可以设置三角箭头。

程序示例

例如如下代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title> 关闭按钮和三角箭头 </title>
<link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="../bootstrap/css/bootstrap-theme.min.css">
</head>

<body>
<div class="container">
<button type="button" class="close" aria-label="关闭">
<span aria-hidden="true">&times;</span>
</button>
<br>
<span class="caret"></span>
</div>
<script type="text/javascript" src="../jquery-3.1.1.js"></script>
<script type="text/javascript" src="../bootstrap/js/bootstrap.min.js"></script>
</body>

</html>