问题:
height:calc(100% - 215px);最后编译成calc(-115%)


解决方法
.main-content: calc(~"100%" - @header-height); 加上 ~ 并加上引号

避免属性被编译,保留原格式,那就将属性当字符串用引号括起来,并在前面加上波浪符 ~,修改后的写法如下:
grid-area: ~"1 / 3 / 3 / 6"
问题:
height:calc(100% - 215px);最后编译成calc(-115%)
解决方法
.main-content: calc(~"100%" - @header-height); 加上 ~ 并加上引号
避免属性被编译,保留原格式,那就将属性当字符串用引号括起来,并在前面加上波浪符 ~,修改后的写法如下:
grid-area: ~"1 / 3 / 3 / 6"
本文标题:less 编译calc异常解决方法
本文链接:https://www.haomeiwen.com/subject/gmhhmqtx.html
网友评论