我的代码必须加高度。可是自适应不用加高度的啊
.TabListItem{
overflow: hidden;
zoom: 1;
}
.TabListItem .ListItem1{
box-sizing: border-box;
text-align: center;
margin-top: 10px;
margin-left: 82px;
margin-right: 10px;
}
.TabListItem .ListItem1 .ItemIcon{
border: 1px solid #efeff4;
}
.TabListItem .ListItem1 .ItemIcon span{
/* width: 100%;
height: auto;*/
display: block;
background: url("../images/Mobile_bg0302.png") center center no-repeat;
background-size:282px 285px;
/* height: 285px;*/
}
背景图片自适应的话,background-size:100% 285px
背景图片自适应?background-size.IE9以上识别。background-size:100% auto;反之。background-size:auto 100%;高度铺满,宽度按比例。但是如果页面窗口resize的时候就需要再判断了,是按高度来还是按宽度来。所以应该用js判断一下