Hi i am using this piece of code to center image in jquery mobile, it centers the image in iphone simulator but when i check it on iphone, it did not exactly centers (centers itself but not exactly) itself but tends towards left.
<div data-role="content" data-theme="a">
<div id="logo_image">
<img src="images/logo.png" alt="Image Header" >
</div>
</div>
and the css is
#logo_image {
text-align: center;
margin-left:0 auto;
margin-right:0 auto;
}
Thanks in advance...
just try margin: 0 auto
instead of left & right margin. you'll be able to set the top and bottom margin afterwards.
greets
Try to add diplay: block
to your image it should position it right.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With