Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

border-shape — custom border geometry

border-shape describes a border using one or two shapes: a stroked path or the region between boundaries.

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

Syntax

border-shape: none | [ <basic-shape> <geometry-box>? ]{1,2};

border-shape accepts none or one or two <basic-shape> values, each with an optional <geometry-box>. Its initial value is none; the property is not inherited.

One shape defines a stroked path. Thickness comes from the relevant border side; the default reference is half-border-box. Two shapes define the outer and inner boundaries in that order, without a comma. Their default references are the border box and padding box respectively; the border fills the region between them.

This is a draft CSS feature, not a support guarantee. The example should show a blue circle with a 5px stroke; without support, a square remains. Verify rendering in the target browser—accepting the syntax alone is insufficient.

Examples

<!doctype html>
<meta charset="utf-8">
<title>border-shape</title>
<style>
  .sample {
    width: 100px;
    height: 100px;
    border: 5px solid blue;
    border-shape: circle(50%);
  }
</style>
<div class="sample"></div>

Result

Supporting implementation: a blue circular border with a 5px stroke. Without support: a blue square border.

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