XML technologies / CSS / Advanced websites with CSS / CSS property reference / -moz-border-radius

(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)

Mozilla-based browsers (including Netscape version 6 and later) support a range of nonstandard CSS properties. These begin with the prefix -moz. Several of these properties are also mentioned in current recommendations for future CSS standards.

The shorthand property -moz-border-radius describes the rounding radius of border corners in a single statement.

The properties -moz-border-radius-bottomleft, -moz-border-radius-bottomright, -moz-border-radius-topleft and -moz-border-radius-topright also allow the rounding of each corner to be declared separately.

Rounded corners do not clip a box’s content, only its background. When using -moz-border-radius, sufficient padding is recommended for the element concerned to avoid overlaps.

Inherited: no

See also: -moz-border-radius-corner

Values

Between one and four space-separated values. Valid values are CSS lengths or percentages from 0% to 50% of the width of the element concerned. The following table describes how the values are assigned.

Table: Value combinations for -moz-border-radius and their effects.

Number of values

Effect

1

The value applies to all four corners.

2

The first value applies to the top-left and bottom-right corners; the second to the top-right and bottom-left corners.

3

The first value applies to the top-left corner, the second to the top-right and bottom-left corners, and the third to the bottom-right corner.

4

The first value applies to the top-left corner, the second to the top-right corner, the third to the bottom-right corner, and the fourth to the bottom-left corner.

Default value: 0

Compatibility

CSS version: not part of the CSS specification

Works only in Mozilla-based browsers, including Netscape version 6 and later.

Equivalent functionality is planned for CSS3. However, the final property and value names will probably differ. For current information, see the CSS Working Group website.

Example

The following style rule creates a circular border around a 100-pixel-wide element of class kreis:

.kreis {
 border: 1px solid red;
 width: 100px;
 height: 100px;
 -moz-border-radius: 50%;
}

  

 

 

 

back to top