我刚刚开始使用jquery mobile,所以请耐心等待。我正在尝试创建一个 ListView ,其中商品的价格在右侧对齐(商品的描述在左侧对齐 - 这部分工作正常)。
我在互联网上进行了搜索,但找不到任何可以帮助我的内容。
这是我的代码:
<div id="home" data-role="page">
<div data-role="header">
<h1>For sale</h1>
</div>
<div data-role="content">
<ul data-role="listview" data-inset="true" data-filter="false">
<li><a href="#itemA">A</a></li> <!-- want to put a right-aligned price in here!-->
<li><a href="#itemB">B</a></li>
<li><a href="#itemC">C</a></li>
<li><a href="#itemD">D</a></li>
<li><a href="#itemE">E</a></li>
</ul>
</div>
</div>
最佳答案
另一个想法:您可以添加一个 2 列网格,请参见此处 http://jquerymobile.com/test/docs/content/content-grids.html
Two column grids
To build a two-column (50/50%) layout, start with a container with a class of ui-grid-a, and add two child containers inside it classed with ui-block-a for the first column and ui-block-b for the second:
<div class="ui-grid-a"> <div class="ui-block-a"><strong>I'm Block A</strong> and text inside will wrap</div> <div class="ui-block-b"><strong>I'm Block B</strong> and text inside will wrap</div> </div><!-- /grid-a -->
Grid classes can be applied to any container
关于jQuery mobile listview - 在右侧添加一些文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13149490/