我使用了PrimeNg的p_galleria,并设置了以下属性:
<p-galleria [images]="productImages"
panelWidth="560"
panelHeight="313"
autoPlay="false"
showFilmstrip="false"
id="product-galley"
showCaption="false">
</p-galleria>
同时我为渲染图像面板添加了样式:
.ui-panel-images {
/*height: inherit !important;
width: inherit !important;*/
/*max-height: inherit !important;
height: initial;
max-width: inherit !important;
width: initial;*/
max-width: 100%;
max-height: 100%;
width:auto;
height:auto;
}
但是图片总是在容器中被拉伸,我希望它能按比例固定,并且位于面板中心。
有没有什么想法可以改变样式?
也许这与问题无关,但我将此画廊包装在bootstrap-modal中。