CSS Border-radius

border-radius

The border-radius shorthand property sets the rounding of the corners of the element.

This property can accept from one to four values.

If all four values are provided, the radius applied to the corners are as specified.

If three values are provided, the second value applies to top-right and bottom-left.

If two values are provided, the first applies to top-left and bottom-right corner, the second applies to top-right and bottom-left corner.

If one value is provided, the radius applies to all 4 corners.

Property Values

Value Description
length Specifies the length of the corner radius
percentage Specifies the length of the corner radius in percent (percentages refer to the corresponding dimensions of the border box)

Examples

The following example shows the basic use of this property:

This produces the following result:

The following examples show some various corner radius values:

Border-top-left-radius

The border-top-left-radius property sets the rounding of the top-left corner of the element.

This property has the following syntax:

When two values are supplied, they define the horizontal and vertical radii of a quarter ellipse, which determines the curvature of the corner of the outer border edge.

When only one value is supplied, it is used to define both the horizontal and vertical radii equally.

Note: If either value is zero, the corner will be square.

Examples

The following example shows the basic use of this property:

This produces the following result:

The following examples show some various corner radius values:

READ  Google Place API for Android to Find City

Border-top-right-radius

The border-top-right-radius property sets the rounding of the top-right corner of the element.

This property has the following syntax:

When two values are supplied, they define the horizontal and vertical radii of a quarter ellipse, which determines the curvature of the corner of the outer border edge.

When only one value is supplied, it is used to define both the horizontal and vertical radii equally.

Note: If either value is zero, the corner will be square.

Examples

The following example shows the basic use of this property:

This produces the following result:

The following examples show some various corner radius values:

Border-bottom-left-radius

The border-bottom-left-radius property sets the rounding of the bottom-left corner of the element.

This property has the following syntax:

When two values are supplied, they define the horizontal and vertical radii of a quarter ellipse, which determines the curvature of the corner of the outer border edge.

When only one value is supplied, it is used to define both the horizontal and vertical radii equally.

Note: If either value is zero, the corner will be square.

READ  Grow Your Business with a Client List

Examples

The following example shows the basic use of this property:

This produces the following result:

The following examples show some various corner radius values:

Border-bottom-right-radius

The border-bottom-right-radius property sets the rounding of the bottom-right corner of the element.

This property has the following syntax:

When two values are supplied, they define the horizontal and vertical radii of a quarter ellipse, which determines the curvature of the corner of the outer border edge.

When only one value is supplied, it is used to define both the horizontal and vertical radii equally.

Note: If either value is zero, the corner will be square.

Examples

The following example shows the basic use of this property:

This produces the following result:

The following examples show some various corner radius values:

Leave a Reply

Your email address will not be published. Required fields are marked *