padding-top:100%解决高度塌陷问题

<div class="img_box">
    <img src="http://sms-shop.oss-cnbeijing.aliyuncs.com/${item.bannerpic.split(',')[0]}"/>
</div>	



.img_box {
		position: relative;
		width: 90%;
		padding-bottom: 100%;
	}

	.img_box img {
		position: absolute;
		top: 0;
		width: 100%;
		height: 100%;
	}
	    								

  

posted @ 2020-04-01 15:58  认认真真玩代码  阅读(1055)  评论(0)    收藏  举报
/* 看板娘 */