PUBLISHED ON: APRIL 15, 2021
CSS border-top-left-radius Property
The border-top-left-radius
property in CSS refers to the rounding of the left corners of a specific element by giving a specific radius of the ellipse, which defines the curvature of the corner.
The round can be an ellipse or a circle or if the value is zero, then the corner remains square instead of round.
Syntax for border-top-left-radius
property:
Following is the syntax for the border-top-left-radius
property.
border-top-left-radius: length|% [length|%]|initial|inherit;
Example: CSS border-top-left-radius
property
Here in the example below, we are using the border-top-left-radius property with different curving or rounding percentages, border styles, and their different values. In this case, we have given the border-top-left radius
as 70% i.e; the top left corner of the container box gets curved to 70%.
<!DOCTYPE html>
<html>
<head>
<title>Border-top-left-radius property in CSS</title>
<style type="text/css">
.border-box {
border-top-left-radius:70%;
border-style: black 4px double;
background-color: red;
background-clip: border-box;
width: 70px;
height: 70px;
}
</style>
</head>
<body>
<div class="border-box">Study Tonight</div>
</body>
</html>
Example 2: CSS border-top-left-radius
property
Here in the example below, we are using the border-top-left-radius
property with different curving or rounding percentages, border styles and their different values. In this case, we have given the border-top-left-radius
using the horizontal and vertical values as 30% and 50% i.e; the top left corner of the container box gets curved to 30% horizontally and 50% vertically.
<!DOCTYPE html>
<html>
<head>
<title>Border-top-left-radius property in CSS</title>
<style type="text/css">
.border-box {
border-top-left-radius: 30% 50%;
border-style: black 4px double;
background-color: purple;
background-clip: border-box;
width: 70px;
height: 70px;
}
</style>
</head>
<body>
<div class="border-box">Study Tonight</div>
</body>
</html>
Output:
Browser Compatibility
There are many browsers that do not support all the latest CSS properties. Hence, while developing any webpage, if you are using any CSS property you must check the browser compatibility for that CSS property and then use it. It is of immense importance today when there is a large variety of web browsers available.
Name of Browser |
Background size |
contain and cover |
Chrome |
4 |
4 |
Edge |
12 |
12 |
Firefox |
4 |
4 |
Internet Explorer |
9 |
9 |
Opera |
10.5 |
10.5 |
Safari |
5 |
5 |
Webview Android |
37 |
37 |
Chrome Android |
18 |
18 |
Firefox Android |
4 |
4 |
Opera Android |
14 |
14 |
IOS Safari |
4.2 |
4.2 |
Samsung Internet |
1.0 |
1.0 |
Conclusion
The initial value for the border-top-left-radius
property is zero. This property is applicable to all elements and also applicable to ::first-letter
. It is not an inherited property. Percentages refer to the corresponding dimensions of the border-box. The computed value of this property is two absolute lengths or percentages. The animation type for this property is a length, a percentage, or a calc().