Add margin to listview

Description

The following code shows how to add margin to listview.

Example


<!--from   www .j a va  2s.  co  m-->
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<script type="text/javascript"
  src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.js"></script>
<link rel="stylesheet" type="text/css"
  href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css">
</head>
<body>
  <style>
.ui-content .ui-listview {
  margin-top: 5px;
  margin-bottom: 5px;
}
</style>
  <div data-role="page" id="page1">
    <div data-role="header">
      <h1>Listview Correction?</h1>
    </div>
    <div data-role="content">
      This text is not hidden anymore
      <ul data-role="listview">
        <li><a href="acura.html">Acura</a></li>
        <li><a href="audi.html">Audi</a></li>
        <li><a href="bmw.html">BMW</a></li>
      </ul>
      <button>This button is not overlapping the listview above</button>
    </div>
  </div>
</body>
</html>

Click to view the demo





















Home »
  jQuery Mobile »
    Example »




Button
Button Event
Button Icon
Button Text
Checkbox
Collapsible
Date
Dialog
Event
Footer
Form
Header
Icon
Input
Layout
Listview
Listview Divider
Listview Item
Loader
mobile_settings
Navbar
Page
Page Event
Popup
Radio
Select
Slider
Switch
Textarea
Theme