CSS Border-Radius Property

The CSS border-radius property can be used to give HTML elements rounded corners. Most commonly, the property is seen using only one value, but it actually will take up to four values.

Assigning one value to the border-radius property will apply that value to every corner of the HTML element. For example, if your CSS looks like this:

Join us in our newest publication:
  1. div{
  2. border-radius: 5px;
  3. }

Then all four corners of your div will have the same amount of rounding applied to them.

borderradius1

If the property is assigned two values, the first value will be applied to the top-left and bottom-right corners, and the second value will be applied to the top-right and bottom-left corners. So if your CSS was something like this:

  1. div{
  2. border-radius: 30px 50px;
  3. }

Your div would take this kind of shape:

borderradius2

If the border-radius property has three values, the first value would be applied to the top left corner of an element, the second value would be applied to the top right and bottom left, and the third value would be applied to the bottom right, like this:

  1. div{
  2. border-radius: 20px 50px 70px;
  3. }

borderradius3

Finally, if the border-radius property has four values, each value would correspond to its own corner of the div. So the first value would be applied to the top-left corner, the second would be applied to the top-right, the third would be applied to the bottom-right, and the fourth would be applied to the bottom-left.

  1. div{
  2. border-radius: 10px 20px 30px 40px;
  3. }

borderradius4

Share and Enjoy !

0Shares
0 0