TyrionGraphiste TyrionGraphiste - 1 month ago 5
CSS Question

Css calc() function, operator +

I wanted to do something in CSS with the calc() function but I have a problem.
I try to do this operation and have an error in console :

width: calc(~"33.33333333%" + unit(20, px));

Console show this message :

ParseError: Unrecognised input in
on line 24, column 3:


24 .title {


Process finished with exit code 1

Yet if I do this, I have no error :

width: calc(~"66.66666667%" - unit(20, px));

Someone would be able to help me and make me understand why this error by changing the operator?

Thank you


Ok, I solve it with trying this :

~"calc(33.33333333% + 20px)";

And it's perfect working.