-1
A
回答
1
我想你可以利用input-groups來做到這一點。但文檔中還提到:
避免使用元素,因爲它們不能在 WebKit瀏覽器中完全樣式化。
HTML在導航欄一<select>
整合:
<form class="navbar-form navbar-left select-search" role="search">
<div class="input-group">
<span class="input-group-addon">
<select class="form-control">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
</span>
<input type="text" class="form-control">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
然後採用下列CSS:
.select-search .input-group-addon {
padding: 0;
border: 0;
}
.select-search .input-group .input-group-addon > select.form-control {
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
演示:http://www.bootply.com/8zPGZ9ySOl
我發現這個效果很好鉻,但在Firefox中選擇箭頭有一些按鈕樣式:
我不知道如何解決在這裏選擇箭頭的樣式。樣式選擇與-moz-appearance:none
或-moz-appearance:menulist
不會幫助。可能與以下相關:Clearing the background of a <select> element's pulldown button with CSS
相關問題
- 1. 導航欄在導航欄上搜索
- 2. 在選項卡欄控制器中搜索導航控制器
- 3. 導航欄中的多個搜索欄
- 4. iOS7導航欄中的搜索欄
- 5. 搜索欄在導航欄下方
- 6. 在導航欄下添加搜索欄?
- 7. 搜索導航邊欄
- 8. 導航欄搜索視圖
- 9. 導航欄搜索結果
- 10. 導航欄後面的搜索欄
- 11. 在數據庫中搜索用戶的導航條搜索欄
- 12. UITableViewController隱藏導航欄[搜索欄]
- 13. 如何在xcode中的導航欄中嵌入搜索欄?
- 14. 在Swift中的導航欄中獲取搜索欄
- 15. Rails:搜索表單在boostrap導航欄
- 16. 如何在iPhone的導航欄中添加搜索欄
- 17. 在iOS 7的導航欄中搜索欄
- 18. CSS導航欄 - 菜單選項不在導航欄內
- 19. Bootstrap 4中心搜索欄在導航欄中
- 20. 在導航欄中,導航選項不在同一行
- 21. 導航下的Bootstrap顯示搜索欄
- 22. 搜索欄未在導航欄中對齊
- 23. 在導航欄中顯示搜索欄IOS7
- 24. 搜索欄在導航欄中改變顏色
- 25. 如何將一個搜索欄放入(不在)導航欄中?
- 26. 如何在iphone導航欄中添加搜索欄?
- 27. 在OSClass的搜索欄中添加地點搜索選項
- 28. 將Magento搜索移至導航欄
- 29. 使Bootstrap導航欄搜索框工作
- 30. 導航欄和搜索控制器
也許bootstrap typeahead是你在找什麼? https://twitter.github.io/typeahead.js/ – ChaoticNadirs 2014-12-19 11:12:10