0

次の HTML を検討してください。

<table>
    <tr>
    <td>
        <span class="author">Author Name</span>
        <div class="imgtitlewrapper">
            <img src="img.png" class="image" width="18px" height="19px" />
            <div class="title">Title of variable length, causing parent div to be of variable height</div>
        </div>
    </td>
    </tr>
</table>

次の CSS を使用します。

<style type="text/css">
    .title {padding-left:8px; margin-left:26px;}
    .image {float:left; padding-left:8px;}
</style>

画像は左に適切に浮いており、タイトルは適切に折り返されていませんが、画像を親divの内側で垂直方向に中央に配置したいと思います。これを行うにはどうすればよいでしょうか。コンテナー タグとレイアウトは変更できますが、すべてテーブル セル内にある必要があります。

4

0 に答える 0