jQuery Mobile - Panel Styling


You can use styles for the panels.


Following example describes the use of panel styling in the jQuery Mobile framework.

<!DOCTYPE html>
      <title>Panel Styling</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>
         h2 {
         .article {
      <div data-role = "page" id = "my_page">
         <div data-role = "header">
            <a href = "#left-panel" data-icon = "grid" 
               data-iconpos = "notext">Right Panel</a>
         <div role = "main" class = "ui-content">
            <div class = "article">
               <h2>jQuery Mobile</h2>
               <p>Query Mobile is a touch-optimized web framework for creating mobile 
               web applications. jQuery Mobile works on all popular smartphones and 
               tablets. jQuery Mobile is built on top of the jQuery library, which makes 
               it easy to learn if you already know jQuery.</p>
         <div data-role = "panel" id = "left-panel">
            <ul data-role = "listview">
               <li data-icon = "home"><a href = "#">India</a></li>
               <li data-icon = "lock"><a href = "#">Srilanka</a></li>
               <li data-role = "audio"><a href = "#">New Zealand</a></li>


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

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

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

Kickstart Your Career

Get certified by completing the course

Get Started