bootstrap切换导航栏
程序员文章站
2024-03-20 19:33:40
...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>bootstrap</title>
<style type="text/css">
div.d1{
padding-top:70px;
}
</style>
</head>
<body>
<script src="jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap/3.3.6/bootstrap.min.css">
<script src="bootstrap/js/bootstrap/3.3.6/bootstrap.min.js"></script>
<div class="d1" style="width:800px;margin:10px">
<ul id="myTab" class="nav nav-tabs">
<li class="active">
<a href="#html" data-toggle="tab">html</a>
</li>
<li><a href="#css" data-toggle="tab">css</a></li>
<li class="dropdown">
<a href="#" id="myTabDrop1" class="dropdown-toggle" data-toggle="dropdown">其它
<b class="caret"></b></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="myTbDrop1">
<li><a href="#ajax" tabindex="-1" data-toggle="tab">ajax</a></li>
<li><a href="#json" tabindex="-1" data-toggle="tab">json</a></li>
</ul>
</li>
</ul>
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade in active" id="html">
<p>htmlhtmlhtmlhtmlhtml</p>
</div>
<div class="tab-pane fade" id="css">
<p>csscsscsscsscsscss</p>
</div>
<div class="tab-pane fade" id="ajax">
<p>ajaxajaxajax</p>
</div>
<div class="tab-pane fade" id="json">
<p>jsonjson</p>
</div>
</div>
</div>
</body>
</html>