Centering elements in jQuery Mobile

jQuery Mobile doesn’t seem to have a css class to center elements (I searched through its css).

But you can write your own additional css.

Try creating your own:

.center-button{
  margin: 0 auto;
}

example HTML:

<div data-role="button" class="center-button">button text</div>

and see what happens. You might need to set text-align to center in the wrapping tag, so this might work better:

.center-wrapper{
  text-align: center;
}
.center-wrapper * {
  margin: 0 auto;
}

example HTML:

<div class="center-wrapper">
  <div data-role="button">button text</div>
</div>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)