Forms 使用引导twitter的表单中存在对齐问题
我这里有一个输入类型和按钮类型的表单Forms 使用引导twitter的表单中存在对齐问题,forms,twitter-bootstrap,alignment,Forms,Twitter Bootstrap,Alignment,我这里有一个输入类型和按钮类型的表单 <div class="span12" style="margin-left: 10px; margin-right: 5px;"> <div class="row-fluid mt20"> <div id="searchBox"> <form id="general-search-form" autocomplete="off"> <inp
<div class="span12" style="margin-left: 10px; margin-right: 5px;">
<div class="row-fluid mt20">
<div id="searchBox">
<form id="general-search-form" autocomplete="off">
<input type="text" placeholder="" class="search-query" name="q" />
<button type="submit" class="btn pull-right" title="search"></button>
</form>
</div>
</div>
</div>
我需要有这样的布局,在桌面版本的输入类型占据50%的宽度和搜索按钮占据50%的宽度。在移动版本中,输入类型应位于顶部,搜索按钮应位于下方。如何操作。在浏览器CSS中将
float:left
设置为两个元素,宽度设置为50%。
对于移动设备CSS,请使用float:none
。尽量使宽度达到100%
这将为您提供所需的输出。可能需要也可能不需要小小的调整 我想你可能想要这样的东西
<form>
<div class="container-fluid">
<div class="row-fluid">
<div class="span6">
<input type="text" class="input-block-level">
</div>
<div class="span6">
<button type="submit" class="btn custom-button">Search</button>
</div>
</div>
</div>
</form>
考虑到填充和边框,您可能需要对按钮宽度进行一些反复尝试。谢谢您的提示。是否有使用跨度的方法?为什么要使用跨度。跨距用于内联元素。表单元素不是内联元素。@HarpreetK。-我想他说的是跨距和引导的关系。span1、span2、span3等是引导中的类,是其网格系统的一部分。
.custom-button {
width: 100%;
}