1

那么是否可以在 jQuery mobile 中居中网格。例如我有这个http://jsfiddle.net/nonamez/Pr8pa/

<div class="ui-grid-d">
    <div class="ui-block-a"><div class="ui-bar ui-bar-e" style="height:60px">A</div></div>
    <div class="ui-block-b"><div class="ui-bar ui-bar-e" style="height:60px">B</div></div>
    <div class="ui-block-c"><div class="ui-bar ui-bar-e" style="height:60px">C</div></div>
    <div class="ui-block-d"><div class="ui-bar ui-bar-e" style="height:60px">C</div></div>
    <div class="ui-block-a"><div class="ui-bar ui-bar-e" style="height:60px">A</div></div>
    <div class="ui-block-b"><div class="ui-bar ui-bar-e" style="height:60px">B</div></div>
    <div class="ui-block-c"><div class="ui-bar ui-bar-e" style="height:60px">C</div></div>
    <div class="ui-block-a"><div class="ui-bar ui-bar-e" style="height:60px">A</div></div>
    <div class="ui-block-b"><div class="ui-bar ui-bar-e" style="height:60px">B</div></div>
    <div class="ui-block-c"><div class="ui-bar ui-bar-e" style="height:60px">C</div></div>
</div>

它看起来像在此处输入图像描述

4

1 回答 1

1

解决方案

工作示例:http: //jsfiddle.net/Gajotres/BFfWc/

改变:

<div class="ui-grid-d">

到:

<div class="ui-grid-c">

HTML:

<div class="ui-grid-c">
    <div class="ui-block-a"><div style="height:60px" class="ui-bar ui-bar-e">A</div></div>
    <div class="ui-block-b"><div style="height:60px" class="ui-bar ui-bar-e">B</div></div>
    <div class="ui-block-c"><div style="height:60px" class="ui-bar ui-bar-e">C</div></div>
    <div class="ui-block-d"><div style="height:60px" class="ui-bar ui-bar-e">C</div></div>
    <div class="ui-block-a"><div style="height:60px" class="ui-bar ui-bar-e">A</div></div>
    <div class="ui-block-b"><div style="height:60px" class="ui-bar ui-bar-e">B</div></div>
    <div class="ui-block-c"><div style="height:60px" class="ui-bar ui-bar-e">C</div></div>
    <div class="ui-block-a"><div style="height:60px" class="ui-bar ui-bar-e">A</div></div>
    <div class="ui-block-b"><div style="height:60px" class="ui-bar ui-bar-e">B</div></div>
    <div class="ui-block-c"><div style="height:60px" class="ui-bar ui-bar-e">C</div></div>
</div>
于 2013-04-30T19:38:11.760 回答