0

我想将 li 元素(listview-item)的高度更改为更小并在垂直中心设置两个文本标题?

在此处输入图像描述

<ul data-role="listview" data-inset="true" data-theme="c" data-dividertheme="b">
   <li data-role="list-divider" class="mid">Neue News</li>
   <li>
      <a href="">
        <img src="news.png" height="40px"/>
        <h2>Title</h2>
        <p>Subtitle</p>
      </a>
   </li>
</ul>
4

1 回答 1

0

也许是这样的:

http://jsfiddle.net/TgkKf/6/

<ul data-role="listview" data-inset="true" data-theme="c" data-dividertheme="b">
   <li data-role="list-divider" class="mid">Neue News</li>
   <li class="newsLink">
  <a href="">
    <img src="https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTy-aBig-8SnIgGIlBOWmy_yMPLTIhXvB77apn5LoHoP1M7k6SCag" height="20px" />
        <div class="wrapperDiv">
            <h2>Title</h2>
            <br />
            <div style="font-size:8px;">Subtitle</div>
        </div>
      <div style="clear:both;"></div>
  </a>

   </li>
<li>
    asdf
</li>
</ul>

CSS

.newsLink
{
    vertical-align:text-top;
}

.newsLink h2
{
   font-size:10px;
}

.newsLink .wrapperDiv
{
    line-height:10px;
    float:left;
}

.newsLink .wrapperDiv div
{
 float:left;   
}

.newsLink img
{
    float:left;
}

.newsLink h2
{
    float:left;
    padding:0;
    margin:0;
}
.newsLink div
{
    padding:0;
    margin:0;
}
于 2013-04-22T23:10:26.103 回答