美文网首页
Sass数字函数-percentage()

Sass数字函数-percentage()

作者: 混吃等死小前端 | 来源:发表于2020-02-20 16:00 被阅读0次

将一个不带单位的数字转换成百分比形式

//.scss
.footer{
    width : percentage(.2)
}
.footer2{
    width : percentage(2px / 10px)//单位计算之后抵消了,结果为0.2
}
//.css
.footer{
    width : 20%
}
.footer2{
    width : 20%
}

相关文章

网友评论

      本文标题:Sass数字函数-percentage()

      本文链接:https://www.haomeiwen.com/subject/hjvxqhtx.html