html - 想要用图像填充缩略图容器,使用 ng-repeat Angularjs

标签 html css angularjs image twitter-bootstrap

我正在使用 Angular 遍历 html 元素并显示图像。但是图像没有填充缩略图容器。我已将最大高度和宽度设置为 最大高度:100%; 最大宽度:100%;

但是图像仍然显示在缩略图容器的一小部分。

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>

最佳答案

.thumbnail.. 中删除填充

.row .col-md-12 .thumbnail{ 
   display: inline-block;
   width: 350px;
   position:relative;
}
img {
    max-height: 100%;
    max-width: 100%;
}

http://www.codeply.com/go/z4mKyQAIfN

关于html - 想要用图像填充缩略图容器,使用 ng-repeat Angularjs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42677837/

相关文章:

css - 页脚没有响应

javascript - 如何在基础 CSS 中水平获取文本渲染列?

javascript - 如何使用 Javascript 为表中的属性分配值

css - SVG 显示值上的紧凑值和标记值

javascript - 错误着陆时不引用父作用域

javascript - 将 HTML Canvas 用于 UI 元素?

css - HTML 5 按钮,在事件状态下放置一个 1px 的按钮,搞砸了,影响超过 1 个按钮,如何解决?

php - 如何修复php非法偏移错误

javascript - 绑定(bind)到 Angular 中的 Controller 对象

javascript - head.js "Modernizr"等功能未检测到 ms-edge