1

リスト ビューのサムネイルを縦に並べるにはどうすればよいですか?
リスト ビュー アイテムはデータベースから動的に生成されるため、リスト アイテムの高さは変化するため、css に (パディング/マージン) 上部属性を追加することは問題外です。

ここに私のサンプルコードがあります:

<ul>
<li><img src='The Thumbnail Image' /><h3>the list heading</h3><p>Long description here (white-space: normal)</p></li>
<li><img src='The Thumbnail Image' /><h3>the list heading</h3><p>Longer description here (white-space: normal)</p></li>
<li><img src='The Thumbnail Image' /><h3>the list heading</h3><p>Longest description here (white-space: normal)</p></li>
</ul>

多分これは私のケースについてより明確な見解を与えるでしょう: http://jsfiddle.net/QdatL/


どんな助けでも大歓迎です。

よろしく、
アルビン。

4

1 に答える 1

1

このコードを追加しました:

li {
   position: relative;   
}

img {
   position: absolute;
   top: 50%;
   left: 5px;
   margin-top: -40px; /* image height/2 */
}

そしてそれはうまくいきました!

デモ

于 2013-02-18T06:49:25.570 に答える