Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

border-top-right-radius — top-right corner radii

The border-top-right-radius property sets the radii of the border’s top-right corner. It accepts one or two nonnegative lengths or percentages.

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

Syntax

border-top-right-radius: <length-percentage [0,∞]>{1,2};

border-top-right-radius sets the radii of the outer edge of the top-right corner. It is a physical property: it targets the same corner regardless of writing direction. Its initial value is 0, and it is not inherited.

One value sets both radii. Two space-separated values specify the horizontal radius followed by the vertical radius, for example 40px 20px. Percentages refer to the border box’s width and height respectively, so a single percentage need not produce a circular arc. Negative values are invalid; zero on either axis makes the corner square.

Do not use a slash in this property — a slash separates axis radii in the border-radius shorthand. If radii are too large and adjacent corners would overlap, the browser proportionally reduces all corner radii.

In the example, only the top-right corner is rounded, with radii of 40px and 20px. With box-sizing: border-box, the 200px × 120px dimensions include the border.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>border-top-right-radius</title>
<style>
  .box {
    box-sizing: border-box;
    width: 200px;
    height: 120px;
    border: 4px solid black;
    background: lightblue;
    border-top-right-radius: 40px 20px;
  }
</style>
<div class="box"></div>
</html>

Result

A 200px × 120px lightblue box with a 4px black border. Only the top-right corner is rounded, with an outer horizontal radius of 40px and an outer vertical radius of 20px.

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