Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

grad — angle unit

The `grad` unit expresses angles in gradians: a full turn is `400grad`, and a right angle is `100grad`. Use it wherever CSS syntax accepts an `<angle>`.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

<number>grad

grad is a unit of the <angle> type, not a CSS property. Write the number directly before the unit, such as 100grad, without a space.

A full turn is 400grad = 360deg = 1turn, so 1grad = 0.9deg. Do not confuse grad with deg: a right angle is 100grad, not 90grad. Use 0grad for zero; a bare 0 is not generally a valid angle.

The example uses linear-gradient(), where 0grad points upward and angles increase clockwise. The value 100grad directs the gradient to the right. Two color stops at 50% create a sharp vertical boundary: the left half is black and the right half is white.

Examples

<!doctype html>
<meta charset="utf-8">
<title>grad</title>
<style>
  .sample {
    width: 200px;
    height: 80px;
    background-image: linear-gradient(100grad, #000 50%, #fff 50%);
    outline: 1px solid #000;
  }
</style>
<div class="sample"></div>

Result

A 200px × 80px rectangle with a black left half, a white right half, a sharp vertical boundary, and a black outline.

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources