-5
A
回答
-1
.px-to-percent(@px, @base){
@percent: unit(((@px/@base) * 100), %);
}
.myclass{
.px-to-percent(456, 1200);
width: @percent;
}
你可以使用一個混合像功能,閱讀文檔:http://lesscss.org/features/#mixins-as-functions-feature – blonfu
哈哈,謝謝! –