gpt4 book ai didi

javascript - Bootstrap 导航栏不完全打开

转载 作者:太空宇宙 更新时间:2023-11-04 02:27:30 27 4
gpt4 key购买 nike

正如您在此 jsfiddle 中看到的那样导航栏不会一直向下打开。我该如何解决这个问题?

 <nav class="navbar navbar-default">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Bienvenue</a>
</div>

<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">

<form class=" form-control navbar-form navbar-left" id="connection_form">
<div class="form-group">
<input type="email" id="email" class="form-control" required placeholder="Email">
<input type="password" id="pass" class="form-control" required placeholder="Mot de Passe">
</div>
<button type="submit" id="connect" class="btn btn-default"><i class="fa fa-spinner fa-spin "></i> Se Connecter</button>
</form>

谢谢。

最佳答案

您只需要从表单中删除form-control:

这个:

<form class="form-control navbar-form navbar-left">

应该是这样的:

<form class="navbar-form navbar-left">

工作示例

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.2/css/font-awesome.min.css" rel="stylesheet" />
<nav class="navbar navbar-default">
<div class="container-fluid">

<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Bienvenue</a>
</div>

<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-left">
<div class="form-group">
<input type="email" id="email" class="form-control" required placeholder="Email">
<input type="password" id="pass" class="form-control" required placeholder="Mot de Passe">
</div>
<button type="submit" id="connect" class="btn btn-default">
<i class="fa fa-spinner fa-spin "></i> Se Connecter
</button>
</form>
</div>

</div>
</nav>

关于javascript - Bootstrap 导航栏不完全打开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37095035/

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