最大高度和最大宽度不起作用

时间:2014-08-14 13:15:29

标签: html css twitter-bootstrap

我正在尝试在我的主页中显示不同大小的图像。我正在使用max-width和max-height,但图像没有正确装饰。我正在使用bootsrap。这是我的PHP代码:

<? while($chanelrow = mysqli_fetch_array($result)) { ?>
<div class="row">
        <div class="col-md-4">
                <a href="#">
                        <img class="img-rounded" src="<?=$chanelrow['chanel_logo']?>" style="max-width:200; max-height:200" alt="">
                </a>
        </div>
        <div class="col-md-8">
                <h3>Project Two</h3>
                <h4>Subheading</h4>
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.
                Ut, odit velit cumque vero doloremque repellendus distinctio
                maiores rem expedita a nam vitae modi quidem similique ducimus!
                Velit, esse totam tempore.</p>
                <a class="btn btn-primary" href="#">View Project <span class="glyphicon glyphicon-chevron-right"></span></a>
        </div>
</div>
<? } ?>

This is the output

如何处理我的图片尺寸?

1 个答案:

答案 0 :(得分:1)

尝试将单位类型(px,%,em等)添加到宽度/高度编号:

<img class="img-rounded" src="<?=$chanelrow['chanel_logo']?>" style="max-width:200px; max-height:200px" alt="">