Percentage Values

A percentage value is expressed as a positive or negative number (when permitted), followed immediately by a percent sign (%). There should never be any space between the number and the percent sign. A percentage value will always be computed relative to something else. For example, declaring font-size: 120%; for an element sets its font size to 120% of the computed font-size of its parent element.

Get CSS Pocket Reference, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.