向列表组添加链接
通过使用锚标签代替列表项,我们可以向列表组添加链接。我们需要使用 <div> 代替 <ul> 元素。下面的实例演示了这点:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Bootstrap历练实例:向列表组添加链接</title>
<meta charset="utf-8" />
<meta name="viewport"content="width=device-width,initial-scale=1.0" />
<link rel="stylesheet" href="bootstrap-3.3.5-dist/css/bootstrap.min.css" />
</head>
<body>
<div style="padding:20px">
<ul class="list-group">
<li class="list-group-item">Html5</li>
<li class="list-group-item">Css3</li>
<li class="list-group-item">Bootstrap</li>
<li class="list-group-item">Javascript</li>
<li class="list-group-item">jQuery</li>
</ul>
<div class="list-group">
<a href="#" class="list-group-item">Html5</a>
<a href="#" class="list-group-item">Css3</a>
<a href="#" class="list-group-item">Bootstrap</a>
<a href="#" class="list-group-item">Javascript</a>
<a href="#" class="list-group-item">jQuery</a>
</div>
<ul class="list-group">
<li class="list-group-item"><a href="#">Html5</a></li>
<li class="list-group-item"><a href="#">Css3</a></li>
<li class="list-group-item"><a href="#">Bootstrap</a></li>
<li class="list-group-item"><a href="#">Javascript</a></li>
<li class="list-group-item"><a href="#">jQuery</a></li>
</ul>
</div>
<script src="jQuery/jquery-2.1.4.js"></script>
<script src="bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
</body>
</html>