css - 是否可以使 .tt-input 更宽?

标签 css twitter-bootstrap twitter-bootstrap-3 typeahead.js

typeahead 示例 on the typeahead website似乎在元素的 style 中使用 3em !important 限制了 .tt-input 的宽度,这样当你输入一些东西时长于 3em 它开始在这个微小的输入中滚出 View 。

如何使 .tt-input 更宽?

这是一个屏幕截图,可以帮助解释我在说什么:http://oi57.tinypic.com/2vvt9qc.jpg .

最佳答案

这似乎被硬编码到 bootstrap-tagsinput.js 中,请参见第 46-47 行:

var inputWidth = (this.inputSize < 3 ? 3 : this.inputSize) + "em";
this.$input.get(0).style.cssText = "min-width: " + inputWidth + " !important;";

inputSize 是根据占位符文本计算的。如果没有,它将默认为 3em。您可能希望更改这些行以获得不同的值,或者完全删除该属性。我不完全确定它为什么在那里。

关于css - 是否可以使 .tt-input 更宽?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26160146/

相关文章:

html - 位置 :absolute reduces height

javascript - 将 js 确认更改为 twitter Bootstrap 模式

html - 元素转换为半像素,文本现在变得模糊

html - 带有静止标题的表格

twitter-bootstrap-3 - 用户界面选择 : set width in Bootstrap grid system

javascript - 使用数据属性的 Bootstrap 词缀仅适用于页面重新加载

javascript - 在没有 jQuery 的情况下使用 JavaScript 在选项卡中创建选项卡

css - 使段落文本在 div 内换行

javascript - 如何在 Javascript 中生成随机柔和(或更亮)的颜色?

html - 如何使 Bootstrap 行背景颜色填充页面的其余部分?