The <percentage>
CSS data type represents a percentage value. It is often used to define a size as relative to an element's parent object. Numerous properties can use percentages, such as width
, height
, margin
, padding
, and font-size
.
Note: Only calculated values can be inherited. Thus, even if a percentage value is used on the parent property, a real value (such as a width in pixels for a <length>
value) will be accessible on the inherited property, not the percentage value.