CSS border-radius propertyThis CSS property sets the rounded borders and provides the rounded corners around an element, tags, or div. It defines the radius of the corners of an element. It is shorthand for border top-left-radius, border-top-right-radius, border-bottom-right-radius and border-bottom-left-radius. It gives the rounded shape to the corners of the border of an element. We can specify the border for all four corners of the box in a single declaration using the border-radius. The values of this property can be defined in percentage or length units. This CSS property includes the properties that are tabulated as follows:
If the bottom-left value is omitted, then it will be same as the top-right. If the value of bottom-right is eliminated, then it will be same as the top-left. Similarly, if top-right is eliminated, then it will be the same as top-left. Let's see what happens when we provide a single value, two values, three values, and four values to this property.
SyntaxProperty valueslength: It defines the shape of the corners. It denotes the size of the radius using length values. Its default value is 0. It does not allow negative values. percentage: It denotes the size of the radius in percentage. It also does not allow negative values. ExampleOutput Test it Now![]() Now, let's see the border-radius for specific corners. Example- border-top-left-radiusIt sets the border radius for the top-left corner. Output Test it Now![]() Example- border-top-right-radiusIt sets the border-radius for the top-right corner. Output Test it Now![]() Example- border-bottom-right-radiusIt sets the border-radius for the bottom-right corner. Output Test it Now![]() Example- border-bottom-left-radiusIt sets the border-radius for the bottom-left corner. Output Test it Now![]() We can specify separate horizontal and vertical values by using the slash (/) symbol. The values before the slash (/) is used for the horizontal radius and the values after the slash (/) are for the vertical radius. There is an example given below using the slash (/) symbol. ExampleOutput Test it Now![]()
Next TopicCSS border-collapse property
|