时间: 2020-09-13|38次围观|0 条评论

<div class="flex-center listing-img">    <img v-if="item.imgUrl" v-bind:src="item.imgUrl" alt="not find picture">    <img v-if="!item.imgUrl" src="../../assets/img/detail-not-image.png"alt="not find picture" v-sf-img></div> img1是默认显示图片.listing-img{
  width:
100%; min-height: 270px; max-height: 320px;}.listing-img>img{  display: inline-block; height: auto; max-width: 100%; max-height: 320px;}.flex-center {  display: flex;  justify-content: center;  align-items: center;}

 

文章转载于:https://www.cnblogs.com/wuliujun521/p/11589474.html

原著是一个有趣的人,若有侵权,请通知删除

本博客所有文章如无特别注明均为原创。
复制或转载请以超链接形式注明转自起风了,原文地址《css使Img图片居中显示
   

还没有人抢沙发呢~