1

我正在使用 Bootstrap 创建一个简单的响应式导航菜单,我遵循了一些教程,但是当我预览我的页面时,设计完全不同并且设计没有响应式。任何人都可以帮忙吗?到目前为止,我的代码如下所示:

<head>
<meta charset="utf-8">
<title>Sara Cook</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Portfolio of my work">
<meta name="author" content="Sara Cook">

<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap-responsive.css">
</head>

<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-th-list"></span>
</a>
    <a href="#" class="brand">Sara Cook</a>
    <div class="nav-collapse colapse">
    <ul class="nav pull-right">
    <li class="active"><a href="#">Home</a></li>
    <li><a href="#">About</a></li>
    <li><a href="#">Portfolio</a></li>
    <li><a href="#">Contact</a></li>
    </ul>
  </div>
  </div>
  </div>
 </div>

<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.0.min.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>

</body>
4

1 回答 1

0

不要两个都用,只用一个,

<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">

已编辑

我相信你正在使用 Bootstrap 3,所以请尝试下面的代码,也请参阅小提琴

<div class="navbar navbar-fixed-top navbar-default">
    <div class="navbar-header"><a href="#" class="navbar-brand">Sara Cook</a><a class="navbar-toggle"
        data-toggle="collapse" data-target=".navbar-collapse">
<span class="glyphicon glyphicon-th-list"></span>
</a>
    </div>
    <div class="container">
        <div class="navbar-collapse colapse">
            <ul class="nav pull-right navbar-nav">
                <li class="active"><a href="#">Home</a>
                </li>
                <li><a href="#">About</a>
                </li>
                <li><a href="#">Portfolio</a>
                </li>
                <li><a href="#">Contact</a>
                </li>
            </ul>
        </div>
    </div>
</div>
于 2013-11-07T13:21:29.387 回答