aboutsummaryrefslogtreecommitdiff
path: root/docs/components.html
diff options
context:
space:
mode:
authorJacob Thornton <[email protected]>2012-02-21 23:18:18 -0800
committerJacob Thornton <[email protected]>2012-02-21 23:18:18 -0800
commitf3b6cf1d6d65ccc640152aa4edb88cbea05a8b45 (patch)
treeb8fff7c4434ad1ee48b4aa2e4afa24b844c0a717 /docs/components.html
parent5ad5dde1e24f668cf9b720dd59fc2a7d4808c0b3 (diff)
parenta139167489e249345933b1e58cc7c53542abab97 (diff)
downloadbootstrap-f3b6cf1d6d65ccc640152aa4edb88cbea05a8b45.tar.xz
bootstrap-f3b6cf1d6d65ccc640152aa4edb88cbea05a8b45.zip
Merge branch '2.0.2-wip' of https://github.com/twitter/bootstrap into 2.0.2-wip
Conflicts: docs/assets/bootstrap.zip less/mixins.less
Diffstat (limited to 'docs/components.html')
-rw-r--r--docs/components.html119
1 files changed, 108 insertions, 11 deletions
diff --git a/docs/components.html b/docs/components.html
index 172fbcf20..8b1a67553 100644
--- a/docs/components.html
+++ b/docs/components.html
@@ -188,12 +188,13 @@
================================================== -->
<section id="buttonDropdowns">
<div class="page-header">
- <h1>Buttons dropdowns <small>Contextual dropdown menus built on button groups</small></h1>
+ <h1>Button dropdown menus <small>Built on button groups to provide contextual menus</small></h1>
</div>
+ <h2>Button dropdowns</h2>
<div class="row">
<div class="span4">
- <h3>Button dropdowns</h3>
+ <h3>Overview and examples</h3>
<p>Use any button to trigger a dropdown menu by placing it within a <code>.btn-group</code> and providing the proper menu markup.</p>
<div class="btn-toolbar" style="margin-top: 18px;">
<div class="btn-group">
@@ -278,10 +279,14 @@
</pre>
</div>
</div>
+ <div class="alert alert-info">
+ <strong>Heads up!</strong> In some cases&mdash;like mobile&mdash;dropdown menus will extend outside the viewport. You need to resolve the alignment manually or with custom javascript.
+ </div>
+ <h2>Split button dropdowns</h2>
<div class="row">
<div class="span4">
- <h3>Split button dropdowns</h3>
+ <h3>Overview and examples</h3>
<p>Building on the button group styles and markup, we can easily create a split button. Split buttons feature a standard action on the left and a dropdown toggle on the right with contextual links.</p>
<div class="btn-toolbar" style="margin-top: 18px;">
<div class="btn-group">
@@ -352,7 +357,30 @@
<li><a href="#">Separated link</a></li>
</ul>
</div><!-- /btn-group -->
- </div>
+ </div><!-- /btn-toolbar -->
+ <h3>Right aligned menus</h3>
+ <p>Add <code>.pull-right</code> to the <code>.dropdown-menu</code> of any button dropdown for right aligned menus.</p>
+ <div class="btn-toolbar">
+ <div class="btn-group">
+ <a class="btn" href="#">Right</a>
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
+ <ul class="dropdown-menu pull-right">
+ <li><a href="#">Action</a></li>
+ <li><a href="#">Another action</a></li>
+ <li><a href="#">Something else here</a></li>
+ <li class="divider"></li>
+ <li><a href="#">Separated link</a></li>
+ </ul>
+ </div><!-- /btn-group -->
+ </div><!-- /btn-toolbar -->
+<pre class="prettyprint linenums">
+&lt;div class="btn-group"&gt;
+ ...
+ &lt;ul class="dropdown-menu pull-right"&gt;
+ &lt;!-- dropdown menu links --&gt;
+ &lt;/ul&gt;
+&lt;/div&gt;
+</pre>
</div>
<div class="span8">
<h3>Example markup</h3>
@@ -368,6 +396,44 @@
&lt;/ul&gt;
&lt;/div&gt;
</pre>
+ <h3>Dropup menus</h3>
+ <p>Dropdown menus can also be toggled from the bottom up by adding a single class to the immediate parent of <code>.dropdown-menu</code>. It will flip the direction of the <code>.caret</code> and reposition the menu itself to move from the bottom up instead of top down.</p>
+ <div class="btn-toolbar" style="margin-top: 9px;">
+ <div class="btn-group dropup">
+ <a class="btn" href="#">Dropup</a>
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
+ <ul class="dropdown-menu">
+ <li><a href="#">Action</a></li>
+ <li><a href="#">Another action</a></li>
+ <li><a href="#">Something else here</a></li>
+ <li class="divider"></li>
+ <li><a href="#">Separated link</a></li>
+ </ul>
+ </div><!-- /btn-group -->
+ <div class="btn-group dropup">
+ <a class="btn primary" href="#">Right dropup</a>
+ <a class="btn primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
+ <ul class="dropdown-menu pull-right">
+ <li><a href="#">Action</a></li>
+ <li><a href="#">Another action</a></li>
+ <li><a href="#">Something else here</a></li>
+ <li class="divider"></li>
+ <li><a href="#">Separated link</a></li>
+ </ul>
+ </div><!-- /btn-group -->
+ </div>
+<pre class="prettyprint linenums">
+&lt;div class="btn-group dropup"&gt;
+ &lt;a class="btn" href="#"&gt;Dropup&lt;/a&gt;
+ &lt;a class="btn dropdown-toggle" data-toggle="dropdown" href="#"&gt;
+ &lt;span class="caret"&gt;&lt;/span&gt;
+ &lt;/a&gt;
+ &lt;ul class="dropdown-menu"&gt;
+ &lt;!-- dropdown menu links --&gt;
+ &lt;/ul&gt;
+&lt;/div&gt;
+</pre>
+
</div>
</div>
</section>
@@ -474,7 +540,7 @@
<h3>Tabs with dropdowns</h3>
<ul class="nav nav-tabs">
<li class="active"><a href="#">Home</a></li>
- <li><a href="#">Profile</a></li>
+ <li><a href="#">Help</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
@@ -485,6 +551,16 @@
<li><a href="#">Separated link</a></li>
</ul>
</li>
+ <li class="dropdown">
+ <a class="dropdown-toggle" data-toggle="dropdown" href="#">Dropup <b class="caret bottom-up"></b></a>
+ <ul class="dropdown-menu bottom-up pull-right">
+ <li><a href="#">Action</a></li>
+ <li><a href="#">Another action</a></li>
+ <li><a href="#">Something else here</a></li>
+ <li class="divider"></li>
+ <li><a href="#">Separated link</a></li>
+ </ul>
+ </li>
</ul>
<pre class="prettyprint linenums">
&lt;ul class="nav nav-tabs"&gt;
@@ -506,7 +582,7 @@
<h3>Pills with dropdowns</h3>
<ul class="nav nav-pills">
<li class="active"><a href="#">Home</a></li>
- <li><a href="#">Profile</a></li>
+ <li><a href="#">Help</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
@@ -517,6 +593,16 @@
<li><a href="#">Separated link</a></li>
</ul>
</li>
+ <li class="dropdown">
+ <a class="dropdown-toggle" data-toggle="dropdown" href="#">Dropup <b class="caret bottom-up"></b></a>
+ <ul class="dropdown-menu bottom-up pull-right">
+ <li><a href="#">Action</a></li>
+ <li><a href="#">Another action</a></li>
+ <li><a href="#">Something else here</a></li>
+ <li class="divider"></li>
+ <li><a href="#">Separated link</a></li>
+ </ul>
+ </li>
</ul>
<pre class="prettyprint linenums">
&lt;ul class="nav nav-pills"&gt;
@@ -787,7 +873,7 @@
<p>An example of a static (not fixed to the top) navbar with project name, navigation, and search form.</p>
<div class="navbar">
<div class="navbar-inner">
- <div class="container" style="width: auto;">
+ <div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
@@ -849,13 +935,24 @@
&lt;/div&gt;
</pre>
<h3>Fixed navbar</h3>
- <p>To make the navbar fixed to the top of the viewport, add <code>.navbar-fixed-top</code> to the outermost div, <code>.navbar</code>.</p>
+ <p>Fix the navbar to the top or bottom of the viewport with an additional class on the outermost div, <code>.navbar</code>.</p>
+ <div class="row">
+ <div class="span4">
<pre class="prettyprint linenums">
&lt;div class="navbar navbar-fixed-top"&gt;
...
&lt;/div&gt;
</pre>
- <p>In your CSS, you will also need to account for the overlap it causes by adding 40px or more of padding to your <code>&lt;body&gt;</code>. Be sure to add this after the core Bootstrap CSS and before the optional responsive CSS.</p>
+ </div><!--/span-->
+ <div class="span4">
+<pre class="prettyprint linenums">
+&lt;div class="navbar navbar-fixed-bottom"&gt;
+ ...
+&lt;/div&gt;
+</pre>
+ </div><!--/span-->
+ </div><!--/row-->
+ <p>When you affix the navbar, remember to account for the hidden area underneath. Add 40px or more of apdding to the <code>&lt;body&gt;</code>. Be sure to add this after the core Bootstrap CSS and before the optional responsive CSS.</p>
<h3>Brand name</h3>
<p>A simple link to show your brand or project name only requires an anchor tag.</p>
<pre class="prettyprint linenums">
@@ -929,8 +1026,8 @@
</pre>
<h3>Component alignment</h3>
<p>To align a nav, search form, or text, use the <code>.pull-left</code> or <code>.pull-right</code> utility classes. Both classes will add a CSS float in the specified direction.</p>
- <h3>Adding dropdowns</h3>
- <p>Adding dropdowns to the nav is super simple, but does require the use of <a href="./javascript.html#dropdowns">our javascript plugin</a>.</p>
+ <h3>Adding dropdown menus</h3>
+ <p>Adding dropdowns and dropups to the nav is super simple, but does require the use of <a href="./javascript.html/#dropdown">our javascript plugin</a>.</p>
<pre class="prettyprint linenums">
&lt;ul class="nav"&gt;
&lt;li class="dropdown"&gt;