Put search icon near textbox using bootstrap

前端 未结 5 1800
清酒与你
清酒与你 2020-12-02 08:51

I am using bootstrap by default textbox taking full width of column and I want to put search icon at the end to textbox.

My code is like this:



        
5条回答
  •  北荒
    北荒 (楼主)
    2020-12-02 09:25

    I liked @KyleMit's answer on how to make an unstyled input group, but in my case, I only wanted the right side unstyled - I still wanted to use an input-group-addon on the left side and have it look like normal bootstrap. So, I did this:

    css

    .input-group.input-group-unstyled-right input.form-control {
        border-top-right-radius: 4px;
        border-bottom-right-radius: 4px;
    }
    .input-group-unstyled-right .input-group-addon.input-group-addon-unstyled {
        border-radius: 4px;
        border: 0px;
        background-color: transparent;
    }
    

    html

提交回复
热议问题