no0ne no0ne - 2 months ago 34
CSS Question

bootstrap dropdown bubble align right (not push-right)

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 right-aligns with 'click'

like this

enter image description here

HTML:

<div class="cart pull-right">
<ul class="nav">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">CLICK</a>
<div class="dropdown-menu">
STUFF
</div>
</li>
</ul>
</div>

Answer

try adding the class .dropdown-menu-right to the same div containing the class dropdown-menu like...

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

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