Easy Tutorial
❮ Css Grid Item Css3 Mediaqueries ❯

CSS3 Rounded Corners


CSS3 Rounded Corners

Using the CSS3 border-radius property, you can create "rounded corners" for any element.

CSS3 Rounded Corner Generator


Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Numbers prefixed with -webkit- or -moz- indicate the first version that supported the prefixed version.

Property Chrome Firefox Safari Opera
border-radius 9.0 5.0 <br>4.0 -webkit- 4.0 <br>3.0 -moz- 5.0 <br>3.1 -webkit- 10.5

CSS3 border-radius Property

Using the CSS3 border-radius property, you can create "rounded corners" for any element.

Here are three examples:

  1. Rounded corners with a background color:

Rounded!

  1. Rounded corners with a border:

Rounded!

  1. Rounded corners with a background image:

Rounded!

The code is as follows:

Example

#rcorners1 {
   border-radius: 25px;
   background: #8AC007;
   padding: 20px;
   width: 200px;
   height: 150px;
}
#rcorners2 {
   border-radius: 25px;
   border: 2px solid #8AC007;
   padding: 20px;
   width: 200px;
   height: 150px;
}
#rcorners3 {
   border-radius: 25px;
   background: url(paper.gif);
   background-position: left top;
   background-repeat: repeat;
   padding: 20px;
   width: 200px;
   height: 150px;
}

CSS3 border-radius - Specifying Each Corner

If you specify only one value for the border-radius property, it will apply to all four corners.

However, if you want to specify each corner individually, you can use the following rules:

Here are three examples:

  1. Four values - border-radius: 15px 50px 30px 5px:

Rounded!

  1. Three values - border-radius: 15px 50px 30px:

Rounded!

  1. Two values - border-radius: 15px 50px:

Rounded!

The source code is as follows:

Example

#rcorners4 {
   border-radius: 15px 50px 30px 5px;
   background: #8AC007;
   padding: 20px;
   width: 200px;
   height: 150px;
}
#rcorners5 {
   border-radius: 15px 50px 30px;
   background: #8AC007;
   padding: 20px;
   width: 200px;
   height: 150px;
}
#rcorners6 {
   border-radius: 15px 50px;
   background: #8AC007;
   padding: 20px;
   width: 200px;
   height: 150px;
}

You can also create elliptical corners:

Example


CSS3 Rounded Corners Properties

Property Description
border-radius Shorthand for all four border-*-*-radius properties
border-top-left-radius Defines the curvature of the top-left corner
border-top-right-radius Defines the curvature of the top-right corner
border-bottom-right-radius Defines the curvature of the bottom-right corner
border-bottom-left-radius Defines the curvature of the bottom-left corner
❮ Css Grid Item Css3 Mediaqueries ❯