bootstrap dropdown bubble align right (not push-right)

后端 未结 5 1918
天命终不由人
天命终不由人 2020-12-29 00:59

I have cart in my top menu, using push-right and my problem is that the dropdown bubble falls out of the page. I am trying to align the bubble right, so that it

相关标签:
5条回答
  • 2020-12-29 01:10

    ok got it!

    position:relative;left:0 on <ul class="dropdown-menu">

    0 讨论(0)
  • 2020-12-29 01:20

    in bootstrap v 3.1.0 the answer to this question is different.

    jsfiddle

    <div class="dropdown-menu pull-menu-right">
           STUFF
    </div>
    
    0 讨论(0)
  • 2020-12-29 01:23
    <div class="dropdown-menu dropdown-menu-right">
    

    This is still working in boostrap 4.2.1 :)

    0 讨论(0)
  • 2020-12-29 01:26

    This can be solved with the bootstrap class dropdown-menu-right with dropdown-menu that is specifically for this problem that uses the css properties right: 0; and left: auto; to right align it.

    This solution is working for me.

    Source - http://getbootstrap.com/components/#btn-dropdowns-dropup (go to developer tools for this)

    0 讨论(0)
  • 2020-12-29 01:31

    Bootstrap 3.1+

    Adding the class .dropdown-menu-right to the same div containing the class dropdown-menu:

    <div class="dropdown-menu dropdown-menu-right">
        STUFF
    </div>
    

    http://getbootstrap.com/components/#dropdowns-alignment

    Bootstrap 2.3 & 3.0

    Add the class .pull-right to the same div containing the class dropdown-menu

    <div class="dropdown-menu pull-right">
        STUFF
    </div>
    

    This seems to work for me using bootstrap 3.0

    0 讨论(0)
提交回复
热议问题