标签:
@media only screen and (max-width:350px){ .img{ width: 80px; height:70px; background-image: url(./images/heart2.png); background-size: 100% 100%; float: left; margin-top: 5%; margin-left: 5%; font-size: 10px; } } @media only screen and (min-width:350px){ .img{ width: 100px; height: 85px; background-image: url(./images/heart2.png); background-size: 100% 100%; float: left; margin-top: 8%; margin-left: 5%; font-size: 10px; } }
根据屏幕大小(长宽)来调整css样式,达到手机屏幕适配的效果。
标签:
原文地址:http://www.cnblogs.com/kangshuai/p/5423959.html