title: Bootstrap drop down menu extends beyond the screen's width
body: <p>Please take a look at this Link <a href="http://jsfiddle.net/bw7k3yee/" rel="nofollow">http://jsfiddle.net/bw7k3yee/</a> Click on where it says "Click Here Please" and notice how the sub-menu extends to the left of the screen.</p>
  
  <p>How Can I fix that please?</p>
  
  <p>Here is the HTML code as well:</p>
  
  
  
  
  
  <p></p>
  
  <p></p>
  
  <pre><code>&lt;div class="navbar navbar-static-top navbar-inverse" style="background-color:purple; margin-top:0px;"&gt;
       &lt;div class=" container"&gt;
  
  
           &lt;button class="navbar-toggle" data-toggle="collapse" data-target=".navHeadCollapse"&gt;
               &lt;span class="icon-bar"&gt;&lt;/span&gt;
               &lt;span class="icon-bar"&gt;&lt;/span&gt;
               &lt;span class="icon-bar"&gt;&lt;/span&gt;
           &lt;/button&gt;
  
  
           &lt;div class= "collapse navbar-collapse navHeadCollapse"&gt;
  
  
              &lt;ul class= "nav navbar-nav navbar-right"&gt;
  
                  &lt;li class="dropdown"&gt;
  
                      &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown" style="color:white"&gt;Click Here Please&lt;b class="caret"&gt;&lt;/b&gt;&lt;/a&gt; 
                      &lt;ul class="dropdown-menu"&gt;
                          &lt;li&gt;&lt;a href="http://twitter.com"&gt;This Sub Menu floats extends beyond the width of the screen&lt;/a&gt;&lt;/li&gt;
                          &lt;li&gt;&lt;a href="http://twitter.com"&gt;This Sub Menu floats extends beyond the width of the screen &lt;/a&gt;&lt;/li&gt;
                      &lt;/ul&gt;
                  &lt;/li&gt;
  
  
                  &lt;li class="dropdown"&gt;
  
                      &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown" style="color:white"&gt;Menu2 Menu2 Menu2&lt;b class="caret"&gt;&lt;/b&gt;&lt;/a&gt;
                      &lt;ul class="dropdown-menu"&gt;
  
                      &lt;/ul&gt;
                  &lt;/li&gt;
  
  
                  &lt;li class="dropdown"&gt;
  
                      &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown" style="color:white"&gt;Menu2&lt;b class="caret"&gt;&lt;/b&gt;&lt;/a&gt;
                      &lt;ul class="dropdown-menu"&gt;
  
                      &lt;/ul&gt;
                  &lt;/li&gt;
  
  
  
                  &lt;li class="dropdown"&gt;
  
                      &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown" style="color:white"&gt;Menu 5&lt;b class="caret"&gt;&lt;/b&gt;&lt;/a&gt;
                      &lt;ul class="dropdown-menu"&gt;
  
                      &lt;/ul&gt;
                  &lt;/li&gt;
  
                  &lt;li class="dropdown"&gt;
  
                      &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown" style="color:white"&gt;Menu 7&lt;b class="caret"&gt;&lt;/b&gt;&lt;/a&gt;
                      &lt;ul class="dropdown-menu"&gt;
  
                      &lt;/ul&gt;
                  &lt;/li&gt;
  
  
                  &lt;li class="dropdown"&gt;
  
                      &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown" style="color:white"&gt;Menu 9&lt;b class="caret"&gt;&lt;/b&gt;&lt;/a&gt;
                      &lt;ul class="dropdown-menu"&gt;
  
                      &lt;/ul&gt;
                  &lt;/li&gt;
  
  
               &lt;li class="dropdown"&gt;
  
                   &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown" style="color:white"&gt;Menu 10&lt;b class="caret"&gt;&lt;/b&gt;&lt;/a&gt;
                   &lt;ul class="dropdown-menu"&gt;
  
                   &lt;/ul&gt;
               &lt;/li&gt;   
              &lt;/ul&gt;
           &lt;/div&gt;
  
       &lt;/div&gt;
       &lt;!-- This creates the login bar on top --&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>    </p>