new315.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>bootstrap的使用</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<script src="https://fastly.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
</head>
<body>
<div class="container">
<ul class="nav nav-tabs" id="tabnav1">
<li class="active"><a href="#news">新闻</a></li>
<li><a href="#pe">体育</a></li>
<li><a href="#ent">娱乐</a></li>
<li><a href="#cars">汽车</a></li>
</ul>
<br>
<div class="tab-content">
<div class="tab-pane active" id="news">新闻的内容</div>
<div class="tab-pane" id="pe">体育的内容</div>
<div class="tab-pane" id="ent">娱乐的内容</div>
<div class="tab-pane" id="cars">汽车的内容</div>
</div>
</div>
<script type="text/javascript">
$('#tabnav1 a').click(function(e){
e.preventDefault();
$(this).tab("show");
});
</script>
</body>
</html>