Change the button width

Description

The following code shows how to change the button width.

Example


<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<style type='text/css'>
.ui-grid-a {<!--from  w w w. j a va  2  s . c  o m-->
  width: 100%;
  height: 200px;
}
</style>
<link rel="stylesheet"
  href="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.css" />
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script
  src="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.js"></script>
</head>
<body>
  <div data-role="page" id="myPage">
    <div data-role="header">
      <h1>My Title</h1>
    </div>
    <!-- /header -->
    <div data-role="content">
      <div data-role="controlgroup" data-type="horizontal"
        class="ui-grid-a">
        <a href="#"
          style="width: 70%; float: left; margin: 0px; padding: 0px;"
          data-role="button" data-transition="fade" data-theme="c">Big
          Button 1</a> 
        <a href="#" style="width: 29%;" data-role="button"
          data-transition="fade" data-theme="a">Small</a>
      </div>
    </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