`<corner-shape-value>` CSS type
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{SeeCompatTable}}
The **<corner-shape-value>** CSS data type describes the shape of a container corner. It is used by the {{cssxref("corner-shape")}} shorthand property and its constituent properties to specify the shape to apply to affected container corners.
Syntax
The <corner-shape-value> data type can take a {{cssxref("superellipse()")}} function that defines a custom shape, or one of six keyword values that describe common superellipse() values.
Values
- {{cssxref("superellipse()")}}
- : Defines a custom corner superellipse shape. A negative parameter creates an inward, or concave, curve while a positive parameter creates an outward, or convex, curve.
- Keywords
- : The available keyword values are as follows:
bevel- : Defines a straight, diagonal corner, which is neither convex nor concave. The
bevelkeyword is equivalent tosuperellipse(0). notch- : Defines a 90-degree concave square corner. The
notchkeyword is equivalent tosuperellipse(-infinity). round- : Defines a convex ordinary ellipse, which is the standard rounded corner created by {{cssxref("border-radius")}} without a
corner-shapeapplied. Theroundkeyword is equivalent tosuperellipse(1). This is the default (initial) value for allcorner-shapeproperties. scoop- : Defines a concave ordinary ellipse. The
scoopkeyword is equivalent tosuperellipse(-1). square- : Defines a 90-degree convex square corner, which is the default corner shape when no
border-radius(orborder-radius: 0) is applied. Thesquarekeyword is equivalent tosuperellipse(infinity). squircle- : Defines a "squircle", which is a convex curve in between
roundandsquare. Thesquirclekeyword is equivalent tosuperellipse(2).
توجه: You can smoothly animate between different superellipse() values, and between different corner shape keywords, as the animation interpolates between their superellipse() equivalents.
Formal syntax
{{csssyntax}}
Examples
<corner-shape-value> value comparison
In this example, we provide a drop-down menu allowing you to select different <corner-shape-value> values and a slider that updates the container's {{cssxref("border-radius")}}. This enables visualizing the effect of the different keywords and superellipse() parameter values.
The corner-shape property defines the shape of the box's corners while the region the shape is applied to is specified by the border-radius property. The code is hidden for brevity, but you can find a [full explanation of corner-shape values](/en-US/docs/Web/CSS/Reference/Properties/corner-shape#comparing_corner-shape_values) along with other related examples on the {{cssxref("corner-shape")}} reference page.
{{EmbedLiveSample("value-comparison", "100%", "300")}}
توجه: See also the [superellipse() function value comparison](/en-US/docs/Web/CSS/Reference/Values/superellipse#superellipse_value_comparison) example.
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
- {{cssxref("corner-shape")}}
- {{cssxref("border-radius")}}
- {{cssxref("superellipse()")}}
- CSS borders and box decorations module