导航栏不显示在Bootstrap中

时间:2017-11-08 09:39:35

标签: asp.net twitter-bootstrap

这是我的第一个bootstrap项目,导航栏没有按预期显示; 以下是我的项目代码



<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="First.aspx.cs" Inherits="BootstrapSecond.First" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <link href="Bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width-device-width,initial-scale=1" />
    <title></title>
</head>
<body>
    <br />
    <div class="container">
        <form id="form1" runat="server">
        <div class="row">
            <div class="col-xs-12">
                <ul class="nav nav-pills nav-justified">
                    <li class="active"><a href="#">Home</a> </li>
                    <li class="active"><a href="#">Tours</a> </li>
                </ul>
            </div>
        </div>
        </form>
    </div>
</body>
</html>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

请改为尝试:

&#13;
&#13;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
  <!-- Latest compiled and minified CSS -->
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

  <!-- jQuery library -->
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

  <!-- Latest compiled JavaScript -->
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width-device-width,initial-scale=1" />
  <title></title>
</head>

<body>
  <nav class="navbar navbar-default">
    <div class="container-fluid">
      <div class="navbar-header">
        <a class="navbar-brand" href="#">Your WebSiteName</a>
      </div>
      <ul class="nav navbar-nav">
        <li class="active"><a href="#">Home</a></li>
        <li class="active"><a href="#">Tours</a> </li>
      </ul>
    </div>
  </nav>
  <div class="container">
    ...Some other body stuff
  </div>
</body>

</html>
&#13;
&#13;
&#13;