less中使用calc

正常写法

div{
  width: calc(100% - 30px);
}

less 写法

div{
  width: calc(~"100% - 30px");
}

less 变量写法

@myHeight: 30px;

div{
  height: calc(~"100% - @{myHeight}");
}

你可能感兴趣的:(less中使用calc)