如何集中JQM网格?

时间:2013-04-30 19:05:05

标签: css jquery-mobile jquery-mobile-grid

因此可以在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>

它看起来像enter image description here

1 个答案:

答案 0 :(得分: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>