2010-10-11 18:25:08 +00:00
<!DOCTYPE html>
< html >
2010-11-02 01:46:29 +00:00
< head >
2011-02-18 20:00:18 +00:00
< meta charset = "utf-8" >
2011-05-17 21:28:19 +00:00
< meta name = "viewport" content = "width=device-width, initial-scale=1" >
2011-02-03 22:29:48 +00:00
< title > jQuery Mobile Docs - Inline buttons< / title >
2011-01-06 00:19:24 +00:00
< link rel = "stylesheet" href = "../../themes/default/" / >
2010-11-11 19:15:42 +00:00
< link rel = "stylesheet" href = "../_assets/css/jqm-docs.css" / >
2011-04-14 20:04:47 +00:00
< script src = "../../js/jquery.js" > < / script >
2011-06-20 19:41:40 +00:00
< script src = "../../experiments/themeswitcher/jquery.mobile.themeswitcher.js" > < / script >
< script src = "../_assets/js/jqm-docs.js" > < / script >
2011-04-14 20:04:47 +00:00
< script src = "../../js/" > < / script >
2010-10-11 18:25:08 +00:00
< / head >
< body >
2011-06-20 19:57:04 +00:00
< div data-role = "page" class = "type-interior" >
2010-10-11 18:25:08 +00:00
2011-06-20 19:57:04 +00:00
< div data-role = "header" data-theme = "f" >
2010-10-11 18:25:08 +00:00
< h1 > Inline buttons< / h1 >
2011-03-10 03:36:14 +00:00
< a href = "../../" data-icon = "home" data-iconpos = "notext" data-direction = "reverse" class = "ui-btn-right jqm-home" > Home< / a >
2010-10-11 18:25:08 +00:00
< / div > <!-- /header -->
2011-03-10 03:36:14 +00:00
< div data-role = "content" >
2011-06-20 20:35:27 +00:00
< div class = "content-primary" >
2010-10-11 18:25:08 +00:00
2010-10-15 21:56:26 +00:00
< p > By default, all buttons in the body content are styled as block-level element so they fill the width of the screen:< / p >
2011-03-10 03:36:14 +00:00
< a href = "index.html" data-role = "button" > Button< / a >
2010-10-15 21:56:26 +00:00
2011-03-10 03:36:14 +00:00
< 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 >
2010-10-15 21:56:26 +00:00
2011-03-10 03:36:14 +00:00
< a href = "index.html" data-role = "button" data-inline = "true" > Button< / a >
2010-10-15 21:56:26 +00:00
2011-07-15 20:11:26 +00:00
< 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 >
2010-10-13 20:38:29 +00:00
< pre > < code >
2011-07-15 20:11:26 +00:00
< a href=" index.html" data-role=" button" data-inline=" true" > Cancel< /a>
< a href=" index.html" data-role=" button" data-inline=" true" data-theme=" b" > Save< /a>
2010-11-16 11:31:44 +00:00
< / code > < / pre >
2010-10-13 20:38:29 +00:00
2011-07-15 20:11:26 +00:00
< p > The result is this:< / p >
2010-10-11 20:19:31 +00:00
2011-03-10 03:36:14 +00:00
< a href = "index.html" data-role = "button" data-inline = "true" > Cancel< / a >
< a href = "index.html" data-role = "button" data-theme = "b" data-inline = "true" > Save< / a >
2010-10-11 20:19:31 +00:00
2010-10-11 18:25:08 +00:00
2010-10-16 01:27:32 +00:00
< 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 >
2010-10-13 20:38:29 +00:00
2011-06-20 20:35:27 +00:00
< / div > <!-- /content - primary -->
< div class = "content-secondary" >
2011-09-29 20:35:31 +00:00
< div data-role = "collapsible" data-collapsed = "true" data-theme = "b" data-content-theme = "d" >
2011-06-20 20:35:27 +00:00
2011-06-20 22:23:09 +00:00
< h3 > More in this section< / h3 >
2011-06-20 20:35:27 +00:00
< ul data-role = "listview" data-theme = "c" data-dividertheme = "d" >
2011-06-20 21:17:04 +00:00
< li data-role = "list-divider" > Buttons< / li >
2011-09-29 17:03:35 +00:00
< li > < a href = "buttons-types.html" > Button basics< / a > < / li >
2011-06-20 21:17:04 +00:00
< li > < a href = "buttons-icons.html" > Button icons< / a > < / li >
< li data-theme = "a" > < a href = "buttons-inline.html" > Inline buttons< / a > < / li >
< li > < a href = "buttons-grouped.html" > Grouped buttons< / a > < / li >
< li > < a href = "buttons-themes.html" > Theming buttons< / a > < / li >
2011-06-20 20:35:27 +00:00
< / ul >
< / div >
< / div >
2010-10-11 18:25:08 +00:00
< / div > <!-- /content -->
2011-06-20 20:35:27 +00:00
< div data-role = "footer" class = "footer-docs" data-theme = "c" >
2011-06-20 22:50:52 +00:00
< p > © 2011 The jQuery Project< / p >
2011-06-20 20:35:27 +00:00
< / div >
< / div > <!-- /page -->
< / body >
< / html >