Bootstrap导航菜单的响应式设计

responsive-nav-finish.html

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>导航菜单的响应式设计</title>
<link href="../bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="../bootstrap/css/bootstrap-responsive.css" rel="stylesheet" type="text/css">
<!--[if lt IE 9]>
      <script src="../bootstrap/js/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
		<h1 class="page-header">导航<small>响应式菜单</small></h1>
		<div class="navbar" >
			<div class="navbar-inner">
				<div class="container">
					<a href="#" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</a>
					<a class="brand" href="Bootstrap"></a>
					
					<!-- 当浏览器窗口宽度小于940像素的时候 ,内容会自动隐藏,内容会作为下拉菜单的内容-->
					<div class="nav-collapse">
					<ul class="nav">
						<li class="active"><a href="#">首页</a></li>
						<li><a href="#">项目一</a></li>
						<li class="dropdown">
							<a class="dropdown-toggle" data-toggle="dropdown" href="#">项目二 
								<span class="caret"></span>
							</a>
							<ul class="dropdown-menu">
								<li><a href="#">下拉菜单项目一</a></li>
								<li><a href="#">下拉菜单项目二</a></li>
							</ul>
						</li>
					</ul>

					<form action="" class="navbar-search">
						<input type="text" class="search-query" />
					</form>
					<ul class="nav pull-right">
						<li><a href="#">登录</a></li>
						<li class="divider-vertical"></li>
						<li><a href="#">注册</a></li>
					</ul>
					</div>
					
				</div>
			</div>

		</div>
		<div style="height: 1580px"></div>

	</div>

	<script src="../bootstrap/js/jquery-1.7.2.min.js"></script>
	<script src="../bootstrap/js/bootstrap.js"></script>
</body>
</html>

css

相关推荐