How do properly use css's "calc()' with ng-style

zihaow picture zihaow · Oct 14, 2015 · Viewed 9.4k times · Source

I have the following inline-styling using Angular's ng-style and css's "calc()', but it didn't work. Can anyone tell me what's wrong?

// my jade file has a class named '.logo-area'. 
.logo-area(ng-style="{'right':'calc(100% -'+({{fixedWidth}}+'px') +')'}")

Answer

zihaow picture zihaow · Oct 14, 2015
.logo-area(ng-style="{'right': 'calc(50% - '+{{fixedWidth}}+'px'+')'}")

Will solve the problem.