4

<button class='btn' />使用时在导航栏中定位元素时遇到问题.pull-left。看到这个jsFiddle:http: //jsfiddle.net/6e49G/

按钮是垂直偏移的,看起来不太好:

4

3 回答 3

4

Just in case anyone stumbles across this like I did, this issue seems to be fixed in version 2.3.0 of Bootstrap. I was running 2.2.2 previously and had this exact problem (input-prepend or input-append), but only with buttons, not icons. As a last resort I thought I'd check for an update of Bootstrap and thankfully that did the trick.

于 2013-02-10T20:49:17.927 回答
3

您还可以将按钮从输入前置 div 中取出,然后将 form-inline 类应用于表单,它应该为您提供所需的内容。见http://jsfiddle.net/6e49G/25/

于 2012-08-21T13:56:52.480 回答
2

看起来引导程序没有设计为在导航栏中附加按钮。我用自定义样式解决了它。您的最高利润来自.navbar样式。

.navbar-form .input-prepend .btn { margin-top: 0px; } ​

代码:http: //jsfiddle.net/6e49G/15/

于 2012-08-21T13:46:12.417 回答