移动端 图片大小方式

1 背景图片设置

width=40px;height=40px的图片;

%icons{
      background: url(i/icons.png) no-repeat;
      background-size: 4rem 4rem;
}

引用:

div{
width: 0.5rem;
height: 0.5rem;
@extend %icons;
background-position: -2.5rem -0.45rem;
}

2:img图片:

设置宽度为100%;

img{
   width: 100%;
}

 

posted @ 2017-03-13 17:10  小猪冒泡  阅读(367)  评论(0编辑  收藏  举报