問(wèn)題描述:要將素材圖(400*250)縮放到頁(yè)面效果(100*100),如果直接按等比例會(huì)出問(wèn)題!
解決方案:
.list-rec li { width: 100px; float: left; display: block; margin: 5px; height: 100px; overflow:hidden } .list-rec li img{ max-width:286px; _width:expression(this.width > 286 ? "286px" : this.width); overflow-x:hidden; /*286是根據(jù)圖片的比例來(lái)計(jì)算出來(lái)的*/ }
Copyright © 2009-2020 JnSuDong.Com All Right Reserved. 魯ICP備19043865號(hào)