Full width input group on bootstrap 3.1.0 navbar

前端 未结 2 438
遇见更好的自我
遇见更好的自我 2021-01-21 19:42

I\'ve got some troubles with bootstrap v3.1.0. I need to get search bar that will fit entire width of the navbar like this (v3.0.3): http://bootply.com/109727 But it feels like

相关标签:
2条回答
  • 2021-01-21 20:17

    For Bootstrap 3.3.6, I solved it by using:

    .navbar-form .input-group .input-group-btn {
        width: 1%;
    }
    
    0 讨论(0)
  • 2021-01-21 20:42

    This issue is the width:auto on .navbar-form .form-control. You can override this with width: 100% and it should work...

    From the 3.1 Docs...

    As a heads up, .navbar-form shares much of its code with .form-inline via mixin. Some form controls, like input groups, may require fixed widths to be show up properly within a navbar.

    Bootstrap 3.1

    .navbar-form .form-control {
        display: inline-block;
        width: auto; /*This is the issue*/
        vertical-align: middle;
    }
    

    Bootstrap 3.0.3

    .navbar-form .form-control {
        display: inline-block;
    }
    
    0 讨论(0)
提交回复
热议问题