June 2025
Beginner
817 pages
31h 30m
English
Sometimes, it can be useful to have the individual specifications calculated and displayed depending on the media feature. In CSS, you can use the calc() function for this purpose, which allows you to perform the basic arithmetic operations, addition (+), subtraction (-), multiplication (*), and division (/). When doing that, you can also mix units and, for example, multiply pixels by a percentage. It’s also important to know that the plus and minus must be preceded and followed by a space, which isn’t necessary for multiplication and division operations.
To demonstrate the use of calc(), we’ll create a simple layout grid with eight sections. In the standard version for screens larger ...
Read now
Unlock full access