jQuery Mobile Toolbars
Toolbar elements are usually located within the header and footer - making navigation easily accessible:
Header bar
The header bar generally contains the page title/logo or one or two buttons (usually home, options, or search).
You can add buttons to the left or right side of the header.
The following code adds a button to the left of the header title text and a button to the right of the header title text:
Example
Try it »
The following code adds a button to the left of the header title text:
Example
Try it »
However, if you place the button link after the
element, the text on the right will not be displayed. To add a button to the right of the header title, specify the class as "ui-btn-right":
Example
Try it »
![]() |
The header can contain one or two buttons, while the footer has no limit. |
|---|
Footer bar
The footer bar is more flexible than the header bar - they are more functional and variable throughout the page, so it can contain as many buttons as needed:
Example
Try it »
**Note:** The footer's style is different from the header (no padding or space, and buttons are not centered). We can use a simple style to solve this problem:
Example
Try it »
You can also group buttons in the footer horizontally or vertically:
Example
data-role="controlgroup" data-type="horizontal"
Try it »
Positioning the header and footer bars
The header and footer can be positioned in three ways:
- Inline - default. The header and footer bars are inlined with the page content.
- Fixed - the header and footer bars are fixed at the top and bottom of the page.
- Fullscreen - basically the same as the Fixed positioning mode, with the header and footer bars fixed at the top and bottom of the page. However, when the toolbar scrolls off the screen, it does not automatically reappear unless the screen is tapped, which is very useful for image or video applications that enhance immersion. Note that in this mode the toolbar covers the page content, so it is best used in rather special situations.
Use the data-position attribute to position the header and footer bars:
Inline positioning (default)
Try it »
Fixed positioning
Try it »
To enable fullscreen positioning, use data-position="fixed" and add the data-fullscreen attribute to the element:
Fullscreen positioning
Try it »
**Tip:** Fullscreen positioning is suitable for photos, images, and videos.
**Tip:** In fixed and fullscreen positioning, tapping the screen will hide and show the header and footer bars.
More examples
Displaying icons only on the toolbar
To display only icons on the toolbar, you can use the ui-btn-icon-notext class.
