我正在寻找创建一个谷歌风格的中心搜索栏的简单索引页面,但我努力使Twitter Bootstrap看起来不错。谷歌搜索栏twitter-bootstrap
搜索栏必须在搜索字段的末尾(右侧)附加一个搜索图标按钮。由于我打算编写一个下拉式搜索建议系统,因此我使用了typeahead。
<div class="hero-unit">
<div class="input-append">
<input type="text" data-provider="typeahead" class="input-large"
placeholder="What do you want to know?" autocomplete="off">
<button type="submit" class="btn-large btn-success">
<i class="icon-search"></i>
</button>
</div>
它也必须比标准的文本框大(高),该功能不是Twitter的引导的稳定版本尚未公布,因此CSS我不得不将其投入的顶部页。
<style>
input[class=input-large] {
width: 540px;
height: 24px;
margin-bottom: 10px;
margin-right: -7px;
line-height: 30px;
padding: 11px 19px;
font-size: 17.5px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
}
我能看到,让搜索按钮更接近搜索栏的唯一方法是使用阴性切缘(当您使用BTN-出现大的空隙)。不是我引以为傲的东西,它看起来非常混乱。
我很感激这方面的一些指导。提前致谢。
尝试使用'input-append'和'add-on';他们从字面上将按钮和栏合并为一个 – Amelia 2013-03-20 15:44:17