gpt4 book ai didi

html - Twitter Bootstrap - 响应式导航栏

转载 作者:行者123 更新时间:2023-11-28 13:19:35 24 4
gpt4 key购买 nike

我不知道我在这里做错了什么。我试图让 Bootstrap 自定义样式的导航栏位于顶部,但在移动设备上响应。

如您所见,这不会发生。让你的窗口低于 940px。

它在我的移动设备上完全搞砸了。我确定我在这里遗漏了一些非常基本的东西。这是我的 HTML:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Social Website</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="./css/bootstrap-responsive.css" rel="stylesheet">
<link href="./css/bootstrap.css" rel="stylesheet">
<link href="./css/main.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800' rel='stylesheet' type='text/css'>
<style>
body {
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
}
</style>

<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="../assets/ico/favicon.png">
</head>

<body>

<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button type="button" 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>
</button>
<a class="brand" href="#">Social Website</a>
<div class="nav-collapse collapse">
<ul class="nav">
<div class="spacer"></div>
<li><a href="#">Uploads</a></li>
<div class="spacer"></div>
<li><a href="#about">Categories</a></li>
<div class="spacer"></div>
<li><a href="#contact">Random</a></li>
<div class="spacer"></div>
</ul>
<ul class="nav pull-right">
<div class="spacer"></div>
<li><a href="#">My Account</a></li>
<div class="spacer"></div>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>

<div class="container">

<h1>Under Construction</h1>
<p>This website is currently under construction, come back later or something.</p>

</div> <!-- /container -->

<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
<script src="./js/bootstrap.min.js"></script>

</body>
</html>

最佳答案

包括
<link href="./css/bootstrap-responsive.css" rel="stylesheet">
<link href="./css/bootstrap.css" rel="stylesheet"> 之后并指定 width对于 .container . http://twitter.github.io/bootstrap/examples/fluid.html 上有一个流体布局示例

关于html - Twitter Bootstrap - 响应式导航栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16239897/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com