我正在使用Angular来遍历html元素并显示图像。但图像不填充缩略图容器。我已将最大高度和宽度设置为 max-height: 100%; max-width: 100%;
想用图像填充缩略图容器,使用ng-repeat Angularjs
但是图像仍显示在缩略图容器的一部分上。
CSS
.row .col-md-12 .thumbnail{
display: inline-block;
width: 350px;
height: 275px;
padding: 10%;
position:relative;
}
img {
max-height: 100%;
max-width: 100%;
}
HTML
<ul class="col-md-12" >
<li class="thumbnail" ng-repeat="course in courses" >
<a ui-sref="course({id:course.id})">
<img ng-src="{{course.picture}}" alt="" />
</a>
</li>
</ul>
尝试用'最小高度:100%;' –
@ sachila ranawaka我试过,但没有奏效。谢谢 –
从'.thumbnail'中删除10%填充。另外,如果图像尺寸不是350 x 275;会有填充'.thumbnail'容器的问题。 – ZimSystem