gpt4 book ai didi

html - Bootstrap - 在跨越多列的导航栏中输入

转载 作者:太空宇宙 更新时间:2023-11-04 12:01:03 25 4
gpt4 key购买 nike

在 Bootstrap 3.3.4 中,我尝试在品牌名称旁边的导航栏中设置一个输入组,该输入组跨越 8 个中央列。不幸的是,输入组要么似乎保持固定大小,要么延伸输入组插件。最接近我想要实现的代码(模这个拉伸(stretch))是这样的:

<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="row">
<div class="col-xs-2">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapsible">
<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="#">Brand</a>
</div>

<div class="col-xs-8">
<form class="navbar-form">
<div class="form-group" style="width: 100%">
<div class="input-group" style="width: 100%">
<input type="text" class="form-control" style="width: 100%">
<span class="input-group-addon">
<span class="glyphicon glyphicon-search"></span>
</span>
</div>
</div>
</form>
</div>
</div>

最佳答案

如果您给表单一个表单类,它将允许表单组根据需要拉伸(stretch)到 100%。

 <nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="row">
<div class="col-xs-2">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapsible">
<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="#">Brand</a>
</div>

<div class="col-xs-8">
<form class="form">
<div class="form-group">
<div class="input-group" style="">
<input type="text" class="form-control">
<span class="input-group-addon">
<span class="glyphicon glyphicon-search"></span>
</span>
</div>
</div>
</form>
</div>
</div>
</nav>

http://codepen.io/anon/pen/QbWMax

关于html - Bootstrap - 在跨越多列的导航栏中输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29807303/

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