bootstrap input group with text select and button

前端 未结 2 1654
遇见更好的自我
遇见更好的自我 2021-02-04 01:38

I would like to have this using bootstrap css:

\"bootstrap

I\'ve written a jsfiddle to make m

相关标签:
2条回答
  • 2021-02-04 02:03

    you can put this type of elements

    LIVE DEMO

    HTML

    <div class="container">
        <div class="col-lg-6">
            <div class="input-group my-group"> 
                <input type="text" class="form-control" name="snpid" placeholder="Test"/>
                <select id="lunch" class="selectpicker form-control" data-live-search="true" title="Please select a lunch ...">
                    <option>Hot Dog, Fries and a Soda</option>
                    <option>Burger, Shake and a Smile</option>
                    <option>Sugar, Spice and all things nice</option>
                    <option>Baby Back Ribs</option>
                    <option>A really really long option made to illustrate an issue with the live search in an inline form</option>
                </select> 
                <span class="input-group-btn">
                    <button class="btn btn-default my-group-button" type="submit">GO!</button>
                </span>
            </div>
        </div>
    <div>
    

    CSS

    .my-group .form-control{
        width:50%;
    }
    

    JQUERY

    if ( $.browser.webkit ) {
        $(".my-group-button").css("height","+=1px");
    }
    
    0 讨论(0)
  • 2021-02-04 02:04

    as document said.

    Avoid using <select> elements here as they cannot be fully styled in WebKit browsers.

    so we should use bootstrap's dropdowns with javascript code instead.

    0 讨论(0)
提交回复
热议问题