2.0_beta sync to rsa
[framework/web/web-ui-fw.git] / libs / js / jquery-mobile-1.1.0 / docs / buttons / buttons-inline.html
1 <!DOCTYPE html> 
2 <html>
3         <head>
4         <meta charset="utf-8">
5         <meta name="viewport" content="width=device-width, initial-scale=1"> 
6         <title>jQuery Mobile Docs - Inline buttons</title> 
7         <link rel="stylesheet"  href="../../css/themes/default/jquery.mobile.css" />  
8         <link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
9
10         <script src="../../js/jquery.js"></script>
11         <script src="../../docs/_assets/js/jqm-docs.js"></script>
12         <script src="../../js/"></script>
13
14 </head> 
15 <body> 
16
17 <div data-role="page" class="type-interior">
18
19         <div data-role="header" data-theme="f">
20                 <h1>Inline buttons</h1>
21                 <a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse">Home</a>
22                 <a href="../nav.html" data-icon="search" data-iconpos="notext" data-rel="dialog" data-transition="fade">Search</a>
23         </div><!-- /header -->
24
25         <div data-role="content">
26                 <div class="content-primary">
27                 <h2>Inline buttons</h2>
28                 <p>By default, all buttons in the body content are styled as block-level element so they fill the width of the screen:</p>
29                 
30                 <a href="index.html" data-role="button">Button</a>
31                 
32                         
33                 <p>However, if you want a more compact button that is only as wide as the text and icons inside, add the <code> data-inline="true"</code> attribute to the button:</p>
34                 
35                 
36                 <a href="index.html" data-role="button" data-inline="true">Button</a>
37                 
38                 <p>If you have multiple buttons that should sit side-by-side on the same line, add the <code> data-inline="true"</code> attribute to each button. This will style the buttons to be the width of their content and float the buttons so they sit on the same line. </p>
39                         
40 <pre><code>
41 &lt;a href=&quot;index.html&quot; data-role=&quot;button&quot; data-inline=&quot;true&quot;&gt;Cancel&lt;/a&gt;
42 &lt;a href=&quot;index.html&quot; data-role=&quot;button&quot; data-inline=&quot;true&quot; data-theme=&quot;b&quot;&gt;Save&lt;/a&gt;
43 </code></pre>
44
45                 <p>The result is this:</p>
46
47                         <a href="index.html" data-role="button" data-inline="true">Cancel</a>
48                         <a href="index.html" data-role="button" data-theme="b" data-inline="true">Save</a>
49                         
50                 <p>Adding the <code>data-mini="true"</code> to the inline buttons creates a more compact version:</p>
51
52                         <a href="index.html" data-role="button" data-inline="true" data-mini="true">Cancel</a>
53                         <a href="index.html" data-role="button" data-theme="b" data-inline="true" data-mini="true">Save</a>
54
55                 
56                 <p>If you want buttons to sit side-by-side but stretch to fill the width of the screen, you can use the <a href="../content/content-grids.html">content column grids</a> to put normal full-width buttons into 2- or 3-columns.</p>     
57                 
58                 <h2>Icon example</h2>
59                 <p>When an <a href="buttons-icons.html">icon</a> is added to an inline button, the button will grow wider to accommodate the icon:<p>
60                         
61                         <a href="index.html" data-role="button" data-icon="delete" data-inline="true">Cancel</a>
62                         <a href="index.html" data-role="button" data-icon="check" data-theme="b" data-inline="true">Save</a>
63                         
64                         <p>A mini version of the same:<p>
65                                 
66                         <a href="index.html" data-role="button" data-icon="delete" data-inline="true" data-mini="true">Cancel</a>
67                         <a href="index.html" data-role="button" data-icon="check" data-theme="b" data-inline="true" data-mini="true">Save</a>
68                 
69                 </div><!--/content-primary -->          
70
71                 <div class="content-secondary">
72
73                         <div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
74
75                                         <h3>More in this section</h3>
76
77                                         <ul data-role="listview" data-theme="c" data-dividertheme="d">
78
79                                                 <li data-role="list-divider">Buttons</li>
80                                                 <li><a href="buttons-types.html">Button basics</a></li>
81                                                 <li><a href="buttons-icons.html">Button icons</a></li>
82                                                 <li data-theme="a"><a href="buttons-inline.html">Inline buttons</a></li>
83                                                 <li><a href="buttons-grouped.html">Grouped buttons</a></li>
84                                                 <li><a href="buttons-themes.html">Theming buttons</a></li>
85
86                                         </ul>
87                         </div>
88                 </div>          
89
90         </div><!-- /content -->
91
92         <div data-role="footer" class="footer-docs" data-theme="c">
93                         <p>&copy; 2011-12 The jQuery Foundation</p>
94         </div>
95
96         </div><!-- /page -->
97
98         </body>
99         </html>