twitter bootstrap issue : Right align the caret in the dropdown header

前端 未结 3 1624
北恋
北恋 2021-01-01 14:56

I have an issue with the right alignment of the caret. Using .pull-right in the span makes it go to the top right corner.

How can I make it vertically centered agai

3条回答
  •  佛祖请我去吃肉
    2021-01-01 15:24

    .caret {
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-top: 8px solid #fff;
        left: 90%;
        top: 45%;
        position: absolute;
    }
    

    Using position absolute and a percentage top and left I was able to right align my caret within the dropdown. Works in Chrome, IE, and FF.

    EDIT

    Previous code will work but changes the style of the caret. If you just want to reposition it maintaining its style, just extend Bootstrap's .caret class:

    .caret {
        position: absolute;
        left: 90%;
        top: 45%;
    }
    

提交回复
热议问题