adding the arrow to dropdown pills for twitter bootstrap?

前端 未结 4 2011
南方客
南方客 2021-02-02 18:02

I got the twitter bootstrap dropdown buttons successfully working, but I have a tiny problem. The black navbar here:

http://twitter.github.com/bootstrap/javascript.html#

4条回答
  •  伪装坚强ぢ
    2021-02-02 18:27

    Here's a refinement to Jason Towne's answer.

    This works correctly if the menu has been pulled to the right.

    .dropdown-menu-arrow::before {
        border-bottom: 7px solid rgba(0, 0, 0, 0.2);
        border-left: 7px solid transparent;
        border-right: 7px solid transparent;
        content: "";
        display: inline-block;
        left: 9px;
        position: absolute;
        top: -7px;
    }
    
    .dropdown-menu-arrow::after {
        border-bottom: 6px solid #FFFFFF;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        content: "";
        display: inline-block;
        left: 10px;
        position: absolute;
        top: -6px;
    }
    
    .btn-group.pull-right > .dropdown-menu-arrow::before {
        left: inherit;
        right: 9px;
    }
    
    .btn-group.pull-right > .dropdown-menu-arrow::after {
        left: inherit;
        right: 10px;
    }
    

    Here's an example of usage.

    
    

提交回复
热议问题