Recently, I started using JQuery mobile to create a mobile website for a local restaurant. To add captions to the images in the menu, I found and utilized the Mosaic JQuery plugin successfully. However, I encountered an issue with the alignment of images on the Android phone browser.
The picture above illustrates that the images are not centered, having margins on the left (blue) and right (red).
Here is the current code:
(HTML)
<div data-role="main" class="ui-content" align="center" >
<div class="hh">
<h2><br>Delicious Meals to taste!</h2>
</div>
<div class="mosaic-block bar2">
<a style="left: 0px; bottom: -50px;" href="maindish.html" target="_blank" class="mosaic-overlay">
<div class="details">
<h4>Delicious Main Dishes inside</h4><br>
<h6>UCLM Restaurant (photo credit: Dan Deroches)</h6>
</div>
</a>
<a href="maindish.html">
<div style="display: block;" class="mosaic-backdrop"><img src="images/maindish/Rosemary-Chicken-Kabob.jpg"></div>
</a>
</div>
<div class="mosaic-block bar2">
<a style="display: inline; left: 0px; bottom: -50px;" href="maindish.html" target="_blank" class="mosaic-overlay">
<div class="details">
<h4>Delicious Main Dishes inside</h4><br>
<p>UCLM Restaurant (photo credit: Dan Deroches)</p>
</div>
</a>
<a href="maindish.html">
<div style="display: block;" class="mosaic-backdrop"><img src="images/maindish/Rosemary-Chicken-Kabob.jpg"></div>
</a>
</div>
</div><!--content-->
(CSS)
.mosaic-block {
float:left;
position:relative;
left:50%;
overflow:hidden;
width:400px;
height:250px;
margin:0px;
background:#111 url(../img/progress.gif) no-repeat center center;
border:1px solid #fff;
-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.5);
}
I attempted to use 'align-center' on each div but it did not work. Any suggestions?