CSS PROPERTIES
Expand All | Collapse All
CSS AT-RULES

CSS3 border-top-right-radius Property

Topic: CSS3 Properties ReferencePrev|Next

Description

The border-top-right-radius property sets the rounded shape for the 'top-right' 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-right-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:

border-top-right-radius: 
[ length | percentage ]1 or 2 values | initial | inherit

This shorthand notation can take one, or two whitespace separated values.

  • The optional second length values define the vertical radii for the top-right 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-right-radius property in action.

div {
    border: 2px solid #f08080;
    border-top-right-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-right-radius property.

Browser Compatibility

The border-top-right-radius property is supported in all major modern browsers.

Browsers Icon

Basic Support—

  • Firefox 4+
  • Google Chrome 4+
  • Internet Explorer 9+
  • Apple Safari 5+
  • Opera 10.5+

Further Reading

See tutorial on: CSS Border, CSS3 Border.

Related properties: border-radius, border-bottom-left-radius, border-bottom-right-radius, border-top-left-radius.

Bootstrap UI Design Templates Property Marvels - A Leading Real Estate Portal for Premium Properties