图片长宽比不同时,依然居中显示
<style>
.exhibitorDetail__product__item_imgs {
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
width: 200px;
height: 200px;
background:red
}
.exhibitorDetail__product__item_imgs img{
max-width: 100%;
max-height: 100%;
}
</style>
<div class="exhibitorDetail__product__item_imgs">
<img src="http://manual.pchi-china.com/highset/file/view/190623018597224450">
</div>
使用说明:
1.宽度和高度依据需求自行修改
2.原理使用的是flex布局