SCSS中的整数

时间:2019-12-24 13:31:11

标签: css sass

我在SCSS中为网格列(12列)提供了一个@for函数。 我的SASS功能:

@for $i from 1 through 12 {
.lp-col.s#{$i} { width: 100%/12 * $i; }
}

CSS结果:

.lp-col.l5 {
width: 41.6666666667%; }

对于所有12列,依此类推

如何将%值四舍五入为41.6666%?

我将Visual Studio Code和Prepros用于CSS编译。

0 个答案:

没有答案