造型jQuery Mobile的列表视图 [英] Styling jquery mobile listviews

查看:125
本文介绍了造型jQuery Mobile的列表视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试风格ListView控件,但有问题的IM ...当我设置图像40PX,如图标记的宽度。我似乎无法得到正确对准左侧的内容。 IE浏览器。我想二硝基甲苯图像与文字之间的差距。这里是我的标记

im trying to style a listview control but im having problems... when i set width of image to 40px as shown in markup. i cant seem to get the content to align properly to the left. ie. i dnt want that gap between image and text. here is my markup

    <ul data-role="listview" class="ui-listview" data-inset="true" role="listbox">
        <li data-role="list-divider" role="heading" tabindex="0" class="ui-li ui-li-divider ui-btn ui-bar-b ui-btn-up-c" style='font-size:8pt;font-weight:normal'>
          <?php echo fmtDate($x->date); ?>,<?php echo $name; ?> wrote on <?php echo $wname; ?>'s wall
          <span class="ui-li-count ui-btn-up-c ui-btn-corner-all" style='right:55px;background: url(../images/comment.png) no-repeat;padding:3px;padding-left:20px'>34</span>
          <span class="ui-li-count ui-btn-up-c ui-btn-corner-all" style='right:5px;background: url(../images/like.gif) no-repeat;padding:3px;padding-left:20px'>442</span>
        </li>

        <li role="option" tabindex="0" data-theme="c" >
        <a href='#'>
        <img width="40" height="40" src='<?php echo $imgstr; ?>'/>
        <div style='font-size:9pt;font-weight:normal;'><?php echo nl2br(addSmilies(urlize(trim($x->msg))));?></div>                
        </a>
        </li>
    </ul> 

我只想澄清这是我的标记从检查元素让

just to clarify this is the markup i get from 'inspect element'

<ul data-role="listview" class="ui-listview ui-listview-inset ui-corner-all ui-shadow" data-inset="true" role="listbox">
                <li data-role="list-divider" role="heading" tabindex="0" class="ui-li ui-li-divider ui-btn ui-bar-b ui-btn-up-c ui-corner-top ui-btn-up-undefined" style="font-size:8pt;font-weight:normal">
                  Today, 55 minute(s) ago,Maggie Ferguson wrote on Maggie's wall
                  <span class="ui-li-count ui-btn-up-c ui-btn-corner-all" style="right:55px;background: url(../images/comment.png) no-repeat;padding:3px;padding-left:20px">34</span>
                  <span class="ui-li-count ui-btn-up-c ui-btn-corner-all" style="right:5px;background: url(../images/like.gif) no-repeat;padding:3px;padding-left:20px">442</span>
                </li>

                <li role="option" tabindex="-1" data-theme="c" class="ui-li-has-thumb ui-btn ui-btn-icon-right ui-li ui-corner-bottom ui-btn-up-c"><div class="ui-btn-inner"><div class="ui-btn-text">
                <a href="#" class="ui-link-inherit">
                <img width="40" height="40" src="../members/mariamjohnson/media/878_thumb.jpg" class="ui-li-thumb ui-corner-bl">
                <div style="font-size:9pt;font-weight:normal;">WAIT A MINUTE,GWE DAN CAN YOU PLEASE BEHAVE YOURSELF,IF YOU HAVE NOTHING TO DO ,GO GET YOURSELF WASTED ELSEWHERE,YOU ARE ABUSIVE AND YOU ARE BEGINING TO IRRETATE ME LIKE A RASH.GURU CHAIN HIM UP,HE SHOULD NOT SPEAK UNTIL SPOKEN TO ,OK?</div>                
                </a>
                </div><span class="ui-icon ui-icon-arrow-r"></span></div></li>
            </ul>

看起来像jQuery Mobile的增加了额外和类的MRKUP ......任何解决方案?

looks like jquery mobile adds extra and classes to the mrkup... any solutions?

推荐答案

添加一个CSS文件您包括jQuery Mobile的CSS后并覆盖样式

Add a CSS file after you include the jQuery mobile CSS and overwrite the style

.ui-li-has-thumb .ui-btn-inner {
    min-height: 60px;
    padding-left: 100px;
}

您的preferred填充,例如

with your preferred padding, e.g.

.ui-li-has-thumb .ui-btn-inner {
    min-height: 60px;
    padding-left: 60px;
}

这篇关于造型jQuery Mobile的列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆