cmplieger cmplieger - 1 month ago 5x
CSS Question

How to use calc() inside another function

Is it possible to use

inside of a CSS function like
I cannot seem to get it working. Here is a demo so you guys can play around:


You can use calc() wherever you can use a length based value in CSS. The example you have provided does work, but actually adds up to 0. Here is a slightly changed demo to illustrate:

Also, make sure to list the unprefixed version last.

Mixing percentages with other value types in the calc() function within a transform doesn't seem to work at all in Chrome. I'll report this as a bug.

UPDATE: This has been reported as a bug here: