【发布时间】:2015-10-28 11:20:26
【问题描述】:
我想这样做
Let sw be screen width, width be a certain element's width.
1. sw = 1200px, width = 1000px = 1000/1200*100vw
2. sw = 940px, width = 800px = 800/940*100vw
3. 940 < sw < 1200, width = linearly scale within the bounds 1. and 2.
在js中很简单width_in_pixel = 1000 + ( sw - 1200 ) * ( 1000 - 940 ) / ( 1200 - 940 );
我知道单位vw,媒体查询@media (min-width: 940px) and (max-width: 1200px) {}但无法解决这个问题,请有人帮助我:
是否可以使用纯 css/sass(无 js)进行缩放?
【问题讨论】: