Bootstrap 3 导航丸不工作
Bootstrap 3 nav-pills not working
我已按照文档进行操作,但不确定为什么我的 pills
无法正常工作。
HTML:
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
<script src="assets/js/script.js"></script>
<link rel="stylesheet" media="all" href="assets/css/style.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="row">
<nav class="nav navbar-nav">
<ul class="nav nav-pills">
<li>blah</li>
</ul>
</nav>
</div>
</div>
</body>
</html>
您的预期结果是什么?你能试着插入一些 <li>
标签看看它是否正常工作吗?
<ul class="nav nav-pills">
<li role="presentation" class="active"><a href="#">Home</a></li>
<li role="presentation"><a href="#">Profile</a></li>
<li role="presentation"><a href="#">Messages</a></li>
</ul>
仅供参考:http://getbootstrap.com/components/#nav-pills
请同时附上上面指定的 assets/css/style.css 文件。建议将 Bootstrap CDN 放在 <head>
的顶部,在您的自定义 css 文件之上。
===========更新===========
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
</head>
<body>
<div class="container">
<div class="row">
<nav class="nav navbar-nav">
<ul class="nav nav-pills">
<li role="presentation"><a href="#">Blah</a></li>
<li role="presentation"><a href="#">Blah</a></li>
<li role="presentation"><a href="#">Blah</a></li>
</ul>
</nav>
</div>
</div>
</body>
</html>
结果:
这是您预期的药丸效果吗?
我已按照文档进行操作,但不确定为什么我的 pills
无法正常工作。
HTML:
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
<script src="assets/js/script.js"></script>
<link rel="stylesheet" media="all" href="assets/css/style.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="row">
<nav class="nav navbar-nav">
<ul class="nav nav-pills">
<li>blah</li>
</ul>
</nav>
</div>
</div>
</body>
</html>
您的预期结果是什么?你能试着插入一些 <li>
标签看看它是否正常工作吗?
<ul class="nav nav-pills">
<li role="presentation" class="active"><a href="#">Home</a></li>
<li role="presentation"><a href="#">Profile</a></li>
<li role="presentation"><a href="#">Messages</a></li>
</ul>
仅供参考:http://getbootstrap.com/components/#nav-pills
请同时附上上面指定的 assets/css/style.css 文件。建议将 Bootstrap CDN 放在 <head>
的顶部,在您的自定义 css 文件之上。
===========更新===========
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
</head>
<body>
<div class="container">
<div class="row">
<nav class="nav navbar-nav">
<ul class="nav nav-pills">
<li role="presentation"><a href="#">Blah</a></li>
<li role="presentation"><a href="#">Blah</a></li>
<li role="presentation"><a href="#">Blah</a></li>
</ul>
</nav>
</div>
</div>
</body>
</html>
结果:
这是您预期的药丸效果吗?