jQuery Mobile - Buttons in Footers


The ui-btn-left and ui-btn-right classes cannot be used in the footer. However, you can still create the same appearance using custom CSS.


Following example demonstrates the use of buttons in footers in jQuery Mobile.

<!DOCTYPE html>
      <title>Buttons in footers</title>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      <link rel = "stylesheet" href = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
      <script src = "https://code.jquery.com/jquery-1.11.3.min.js"></script>
      <script src = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
         .footer-button-right {
            position: absolute;
            margin: 0;
            top: auto;
            bottom: 0.24em;
         .footer-button-left {
            left: 0.4em;
         .footer-button-right {
            right: 0.4em;
      <div data-role = "footer">
         <a href = "#" class = "ui-btn ui-corner-all ui-btn-inline ui-mini 
            footer-button-left ui-btn-icon-left ui-icon-home">Home</a>
         <a href = "#" class = "ui-btn ui-corner-all ui-btn-inline ui-mini 
            footer-button-right ui-btn-icon-right ui-icon-gear">Options</a>


Let's carry out the following steps to see how the above code works −

  • Save the above html code as toolbar_buttons_footer.html file in your server root folder.

  • Open this HTML file as http://localhost/toolbar_buttons_footer.html and the following output will be displayed.

Kickstart Your Career

Get certified by completing the course

Get Started