Search code examples
twitter-bootstrapbootstrap-select

Bootstrap-select align only text right


I want to align the text of the dropdown to the right and keep the carret at his place. I got a long form and every icon are on the right, so moving the carret is not an option. I found how the get the option on the right, but the selected one stay on the left.

I try an issue by overriding the js.min, but I need to have other dropdown somewhere else left align. So I ask for your help.

There is the code:

<div class="form-group oa-vert-marg-2 pull-right">
    <label class="col-sm-4 control-label" for="pmtType">Type de paiement&nbsp;&nbsp;&nbsp;</label>
    <div class="col-sm-8 input-group pad-btm pull-right">
        <select class="selectpicker" data="pull-right" data-style="text-right" id="pmtType" dir="rtl">
            <option class="text-right">Hebdomadaire</option>
            <option class="text-right">Quinzaine</option>
            <option class="text-right" selected>Mensuel</option>
        </select>
    </div>
</div>

This is how it look: actual

This is how it should look: wanted

Thank you for helping!


Solution

  • for that, you should custom your CSS, so add the following style:

    .bootstrap-select.btn-group .btn .filter-option {
       text-align: right   
    }