CSS <angle-percentage> Data Type
The <angle-percentage> data type is a value that can be either an <angle> or a <percentage>, where the percentage resolves to an angle.
Description
The <angle-percentage> CSS data type represents a value that can be either an <angle> or a <percentage>. It appears in property and function syntax wherever a percentage can stand in for an angle. When a percentage is used, it is resolved against a reference angle defined by the context; in practice that is almost always a full turn of 360deg, so 25% equals 90deg.
The main place you will meet <angle-percentage> is the color stops of conic-gradient() and repeating-conic-gradient(). A conic gradient sweeps around a centre point, and each color stop says where around the circle that color sits. Writing stops as percentages is often more natural, for example for pie charts, where a slice of 30% of the data is simply 0% 30%. Angles and percentages can be mixed in the same gradient and combined in calc().
Not every property that accepts an angle accepts a percentage. For example, rotate(), skew(), hue-rotate() and the gradient direction of linear-gradient() only accept <angle> values, so rotate(25%) is invalid. Check the syntax of each property before using a percentage.
Examples
/* Pie chart with percentage stops */
.pie {
border-radius: 50%;
background: conic-gradient(
#2563eb 0% 45%,
#16a34a 45% 75%,
#f59e0b 75% 100%
);
}
/* The same stops written as angles */
.pie-angles {
background: conic-gradient(#2563eb 0deg 162deg, #16a34a 162deg 270deg, #f59e0b 270deg 360deg);
}
/* Angles and percentages can be mixed */
.mixed {
background: conic-gradient(from 45deg, red 0deg 25%, orange 25% 180deg, yellow 180deg 100%);
}
Interactive Demo
Syntax
<angle-percentage> = <angle> | <percentage>
Values
- <angle>Refer to <angle> for possible values
- <percentage>Refer to <percentage> for possible values
Example
Browser Support
The following information will show you the current browser support for the CSS angle-percentage data type. Hover over a browser icon to see the version that first introduced support for this CSS data type.
Desktop





Tablets & Mobile





