如何将页脚中的水平控制组居中 - 在jqm 1.1.1中更改?

tj_*_*oll 7 center footer jquery-mobile

这曾经用于将控制组集中在1.1.0中,但现在看起来好像它不在1.1.1中.

<div data-theme="a" data-role="footer" style="text-align:center;">
   <div data-role="controlgroup" data-type="horizontal" data-mini="true">
      <a href="foo" data-role="button">link1</a>
      <a href="boo" data-role="button">link2</a>
   </div>
   <div class="copy">&copy; 2012 bigco</div>
</div>
Run Code Online (Sandbox Code Playgroud)

gum*_*ins 11

可能是data-role ="controlgroup" div的align ="center"属性可能适合于此.

<div data-theme="a" data-role="footer" align="center">
   <div data-role="controlgroup" data-type="horizontal" data-mini="true">
      <a href="foo" data-role="button">link1</a>
      <a href="boo" data-role="button">link2</a>
   </div>
   <div class="copy">&copy; 2012 bigco</div>
</div>
Run Code Online (Sandbox Code Playgroud)

http://jsfiddle.net/sGFTy/1/


Fra*_*ank 5

我在这个网站上找到了解决方案:http: //forum.jquery.com/topic/how-to-horizo​​ntally-center-a-set-of-grouped-buttons

CSS:

#navgroup {text-align:center;}
#navgroup div {display:inline-block;}
Run Code Online (Sandbox Code Playgroud)

HTML:

<div id="navgroup">
    <div data-role="controlgroup" data-type="horizontal">
      <a href="index.htm" data-role="button" data-theme="e" data-mini="true" class="active menu">Menu</a>
      <a href="specials.htm" data-role="button" data-theme="e" data-mini="true" class="specials">Specials</a>
      <a href="howitworks.htm" data-role="button" data-theme="e" data-mini="true" class="howitworks">FAQ</a>
      <a href="http://www.facebook.com" data-rel="external" data-role="button" data-theme="e" data-mini="true"  class="feedback">Facebook</a>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)