how to make twitter bootstrap submenu to open on the left side?

前端 未结 12 2109
余生分开走
余生分开走 2020-12-13 05:12

I was trying to create twitter bootstrap submenu in dropdown menu, but I\'ve got a problem: I have dropdown menu in the top right corner of the page and that menu has one mo

12条回答
  •  感情败类
    2020-12-13 05:48

    If you're using LESS CSS, I wrote a little mixin to move the dropdown with the connecting arrow:

    .dropdown-menu-shift( @num-pixels, @arrow-position: 10px ) {  // mixin to shift the dropdown menu
        left: @num-pixels;
        &:before { left: -@num-pixels + @arrow-position; }        // triangle outline
        &:after  { left: -@num-pixels + @arrow-position + 1px; }  // triangle internal
    }
    

    Then to move a .dropdown-menu with an id of dropdown-menu-x for example, you can do:

    #dropdown-menu-x {
        .dropdown-menu-shift( -100px );
    }
    

提交回复
热议问题