<button class='btn' />
使用时在导航栏中定位元素时遇到问题.pull-left
。看到这个jsFiddle:http: //jsfiddle.net/6e49G/
按钮是垂直偏移的,看起来不太好:
<button class='btn' />
使用时在导航栏中定位元素时遇到问题.pull-left
。看到这个jsFiddle:http: //jsfiddle.net/6e49G/
按钮是垂直偏移的,看起来不太好:
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.
您还可以将按钮从输入前置 div 中取出,然后将 form-inline 类应用于表单,它应该为您提供所需的内容。见http://jsfiddle.net/6e49G/25/
看起来引导程序没有设计为在导航栏中附加按钮。我用自定义样式解决了它。您的最高利润来自.navbar
样式。
.navbar-form .input-prepend .btn { margin-top: 0px; }
代码:http: //jsfiddle.net/6e49G/15/