为TextView和ImageView制作正确的布局

时间:2014-09-30 21:27:37

标签: layout textview imageview

需要使用什么布局来制作它?

enter image description here

1 个答案:

答案 0 :(得分:0)

HTML

<h1>Title</h1>
<div id="itemWrapper">
    <div class="item">
        <div class="png">
            <img src="xxx.png">
        </div>
        <div class="text">
            text text text text text text text text text text
        </div>
    </div>
    <div class="item">
        <div class="png">
            <img src="xxx.png">
        </div>
        <div class="text">
            text text text text text text text text text text
        </div>
    </div>
    <div class="item">
        <div class="png">
            <img src="xxx.png">
        </div>
        <div class="text">
            text text text text text text text text text text
        </div>
    </div>
    <div class="item">
        <div class="png">
            <img src="xxx.png">
        </div>
        <div class="text">
            text text text text text text text text text text
        </div>
    </div>
</div>

CSS

.item{clear:both;}
.item .png{float:left;height:50px}
.item .text{float:left;height:50px}
h1{text-align:center}