2015-08-28 22 views
1
@x : 1000px; 

width: @x - 20%; 

因此,值應該是800,而是980:以較少的css表示的值的百分比

誰知道爲什麼

+0

http://stackoverflow.com/questions/8762225/how-to -calculate-percentages-in-less-css ----這是否有幫助? –

+0

'width:@x * .8;'其中'.8'顯然是'(100-20)/ 100'。 –

回答

1

您可以使用下面的

width: @x - (@x/5); 

或任何特定的百分比:

width: @x - ((@x/100)*(100-20));