Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

deg — degrees of an angle

The deg unit expresses CSS angles in degrees: 360deg is a full turn and 90deg is a quarter turn. Use it where the syntax accepts the <angle> type.

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

Syntax

<number>deg

deg is a unit of the <angle> type, not a CSS property. Write a number directly before the unit, without whitespace: 45deg, -90deg, 22.5deg. A value is valid only in a context accepting an angle; width: 90deg is invalid.

A full turn is 360deg = 400grad = 2π rad = 1turn. All these units are compatible, and deg is their canonical unit. The permitted value range depends on the property or function.

Do not assume that bare 0 always replaces 0deg. Some legacy contexts allow this exception, but generally you should include the unit even for zero.

The meaning of direction depends on how the angle is used. In the example, transform: rotate(90deg) rotates the arrow a quarter turn clockwise, so an arrow initially pointing right points downward.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>deg example</title>
<style>
  .arrow {
    width: 80px;
    margin: 60px;
    font: 48px/1 monospace;
    text-align: center;
    transform: rotate(90deg);
  }
</style>
<div class="arrow">&#8594;</div>
</html>

Result

↓

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