Theme Precedence

Description

Themes are applied to components with the following order of precedence:

  • Explicit themes - explicitly set data-theme attribute overrides any inherited or default theme.
  • Inherited themes - Inherited themes override all default themes.
  • Default themes - Default themes are applied when no themes are explicitly set or inherited.

Example


<!DOCTYPE html>
<html>
<head>
<meta name="viewport"
  content="width=device-width, minimum-scale=1, maximum-scale=1">
<link rel="stylesheet"
  href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
<style>
.ui-content {<!--from w  w  w  .  j a  va  2 s  .c o m-->
  min-height: inherit;
}
</style>
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
</head>
<body>

  <div data-role="page" data-theme="a">
    <div data-role="header">
      <h1>min-height:inherit</h1>
    </div>

    <div data-role="content" data-theme="c">

      <ul data-role="listview" data-inset="true">
        <li data-role="list-divider">List Divider</li>
        <li>Element #1</li>
        <li>Element #2</li>
      </ul>

    </div>
  </div>
</body>
</html>

Click to view the demo





















Home »
  jQuery Mobile »
    Tutorial »




jQuery_Mobile
Form
List
Layout
Theme