WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

CSS3 Rounded Corners


CSS3 Rounded Corners

With the CSS3 border-radius property, you can give any component "rounded corners".


Browser Support

The numbers in the table determine the primary program form that completely underpins the property.

Numbers pursued by - webkit-or - moz-indicate the main form that worked with a prefix.

Property
border-radius 5.0
4.0 - webkit-
12.0 9.0 4.0
3.0 - moz-
5.0
3.1 - webkit-
10.5

CSS3 fringe range Property

With CSS3, you can give any component "rounded corners", by utilizing the border-radius property.

Here are three examples:

1. Adjusted corners for a component with a predefined foundation color:

Rounded corners!

2. Adjusted corners for a component with a border:

Rounded corners!

3. Adjusted corners for a component with a foundation image:

Rounded corners!

Here is the code:

Example

#rcorners1 {
    outskirt range: 25px;
    foundation: hotpink;
    cushioning: 20px;
    width: 200px;
    tallness: 150px;
}

#rcorners2 {
    outskirt range: 25px;
    fringe: 2px strong hotpink;
    cushioning: 20px;
    width: 200px;
    tallness: 150px;
}

#rcorners3 {
    outskirt range: 25px;
    foundation: url(W1-icon.png);
    foundation position: left top;
    foundation rehash: repeat;
    cushioning: 20px;
    width: 200px;
    stature: 150px;
}
Try it yourself »

CSS3 fringe sweep - Specify Each Corner

If you indicate just a single an incentive for the border-radius property, this sweep will be connected to each of the 4 corners.

However, you can determine each corner independently in the event that you wish. Here are the rules:

  • Four values: first esteem applies to upper left, second esteem applies to upper right, third esteem applies to base right, and fourth esteem applies to base left corner
  • Three values: first esteem applies to upper left, second esteem applies to upper right and base left, what's more, third esteem applies to base right
  • Two values: first esteem applies to upper left and base right corner, and the second esteem applies to upper right and base left corner
  • One value: every one of the four corners are adjusted equally

Here is the code:

Example

#rcorners4 {
    fringe sweep: 15px 50px 30px 5px;
    foundation: hotpink;
    cushioning: 20px;
    width: 200px;
    stature: 150px;
}

#rcorners5 {
    fringe sweep: 15px 50px 30px;
    foundation: hotpink;
    cushioning: 20px;
    width: 200px;
    stature: 150px;
}

#rcorners6 {
    fringe sweep: 15px 50px;
    foundation: hotpink;
    cushioning: 20px;
    width: 200px;
    stature: 150px;
}
Try it yourself »

You could likewise make curved corners:

Example

#rcorners7 {
    fringe sweep: 50px/15px;
    foundation: hotpink;
    cushioning: 20px;
    width: 200px;
    stature: 150px;
}

#rcorners8 {
    fringe sweep: 15px/50px;
    foundation: hotpink;
    cushioning: 20px;
    width: 200px;
    stature: 150px;
}

#rcorners9 {
    fringe sweep: 50%;
    foundation: hotpink;
    cushioning: 20px;
    width: 200px;
    stature: 150px;
}
Try it yourself »