CSS3 border-top-left-radius
Property
Topic: CSS3 Properties ReferencePrev|Next
Description
The border-top-left-radius
CSS property sets the rounded shape for the "top-left" corner of an element border box.
The following table summarizes the usages context and the version history of this property.
Default value: | 0 |
---|---|
Applies to: | All elements |
Inherited: | No |
Animatable: | Yes. See animatable properties. |
Version: | New in CSS3 |
Note: The border-top-left-radius
property causes the element's background to be rounded even if no borders have been defined or its value is set to none
.
Syntax
The syntax of the property is given with:
This shorthand notation can take one, or two whitespace separated values.
- The optional second length values define the vertical radii for the top-left corner and the corner shape is thus a quarter ellipse.
- If the second length is omitted, or it is equal to the first – the corner shape is a quarter circle. If either length is zero, the corner is square, not rounded.
The example below shows the border-top-left-radius
property in action.
Example
Try this code »div {
border: 2px solid #f08080;
border-top-left-radius: 20px;
}
Property Values
The following table describes the values of this property.
Value | Description |
---|---|
length | A length value in px , pt , cm , em , etc. Negative values are not allowed. |
percentage | The size of the radius in percentage. In case of two values, percentage for the first value (i.e. horizontal radius) is calculated with respect to the width of the element's box, while percentage for the second value (i.e. vertical radius) is calculated with respect to the height of the element's box. Negative values are not allowed. |
initial |
Sets this property to its default value. |
inherit |
If specified, the associated element takes the computed value of its parent element border-top-left-radius property. |
Browser Compatibility
The border-top-left-radius
property is supported in all major modern browsers.
Basic Support—
|
Further Reading
See tutorial on: CSS Border, CSS3 Border.
Related properties: border-radius
, border-bottom-left-radius
, border-bottom-right-radius
, border-top-right-radius
.