calc less does not work under

Css3 calc not use the property can not be less

css3 length calculating new attribute can be calculated depending on the width of the unit

.test{
  width: calc(100% - 150px);
}

But when we use this method in less of it there is a problem:

less in the wording:
.test {
  width: Calc (100% - by 150px)
}

After compiling less:
.test {
  width: -50%;
}

The reason this problem is now less computing calc way and sent the conflict, to solve this problem can be set up:

.test{
  width: calc(~"100% - 50px");
} 
  If operation between the value of the variable and can be set up:
@diss = 50px
.test{
  width: calc(~"100% - @{diss}")
}

Guess you like

Origin www.cnblogs.com/supershare/p/12532176.html