提前扩展引导程序的宽度以匹配输入字段 [英] extending the width of bootstrap typeahead to match input field
问题描述
我知道这个问题至少被问过三遍,但是我看到的答案并不是我想要的.我希望通过它的typeahead函数增加twitter bootstrap生成的自动完成字段的宽度.我一直在阅读,它涵盖了该领域中的所有文本.也就是说,文本越长,自动完成字段越宽.但是我希望它是一个span6,因为那是我的搜索范围.有任何想法吗?我已经看到了一些jquery的答案,但我无法关注它们.
I know this question has been asked atleast three times before but the answer I saw were not what I was looking for. I am looking to increase the width of the autocomplete field that twitter bootstrap generates with its typeahead function. I have been reading that it stretches to cover all the text with in the field. that is to say that the longer the text, the wider the autocomplete field. However I would like it to be a span6 because that is how wide my search field is. Any ideas? I have seen some jquery answers but I couldn't follow them.
推荐答案
迈克尔·沃森(Michael Watson)在他的评论中给出了我认为最简单的答案.
Michael Watson gave what I think is the simplest answer in his comment.
.twitter-typeahead { width: 100%; }
更新#1::根据以下评论(感谢Steve,Vishi),对.tt-hint
,.tt-input
,.tt-dropdown-menu
执行相同的操作.
Update #1: Based on the comments below (thanks Steve, Vishi), do the same for .tt-hint
, .tt-input
, .tt-dropdown-menu
.
更新#2: mlissner报告说.tt-dropdown-menu
现在是.tt-menu
,所以最终结果是
Update #2: mlissner reports that .tt-dropdown-menu
is now .tt-menu
, so the end result is
.twitter-typeahead, .tt-hint, .tt-input, .tt-menu { width: 100%; }
这篇关于提前扩展引导程序的宽度以匹配输入字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!