Why CSS calc() function is not working with complex expression?
问题 Why this one calc(100vw/4) works but neither of the following do? calc(100vw/4-(10-4)) calc(100vw/4-(10px-4)) calc(100vw/4-(10px-4px)) calc(100vw/4-calc(10px-4px)) How do I manage the the expression calc(100vw/x-(10px-x)) where x gets replaced in a SASS loop to work? 回答1: You need to add spaces between operators, it's a common mistake to forget them. We can also nest operation using calc as many as we want but they are equivalent to simple parentheses. From the documentation: Note : The + and