CSS border-top-left-radius Property
The border-top-left-radius property controls the rounding of an element's top-left corner.
It accepts one or two non-negative length or percentage values. A single value creates a circular corner, while two values define the horizontal and vertical radii of an elliptical corner.
The property affects the physical top-left corner regardless of writing mode or text direction. It can round an element's background and border even when no visible border is defined.
border-top-left-radius Syntax
The property accepts one or two values that specify the corner's horizontal and vertical radii.
selector {
border-top-left-radius: 20px;
}
The general syntax is:
selector {
border-top-left-radius: <length-percentage> <length-percentage>?;
}
Single Length Value
.panel {
border-top-left-radius: 20px;
}
Both radii are 20 pixels, producing a circular corner.
Two Length Values
.panel {
border-top-left-radius: 40px 20px;
}
The horizontal radius is 40 pixels and the vertical radius is 20 pixels.
Percentage Value
.panel {
border-top-left-radius: 25%;
}
Mixed Values
.panel {
border-top-left-radius: 30% 20px;
}
Removing the Radius
.panel {
border-top-left-radius: 0;
}
Calculated Radius
.panel {
border-top-left-radius: clamp(10px, 4vw, 40px);
}
CSS-Wide Keywords
.inherited {
border-top-left-radius: inherit;
}
.reset {
border-top-left-radius: initial;
}
.unset {
border-top-left-radius: unset;
}
.reverted {
border-top-left-radius: revert;
}
.layer-reverted {
border-top-left-radius: revert-layer;
}
CSS-wide keywords must be used alone rather than combined with radius values.
Property Values
The border-top-left-radius property accepts non-negative lengths, percentages, or combinations of the two.
| Value | Description |
|---|---|
<length> |
Defines a radius using a non-negative length such as px, rem, or em. |
<percentage> |
Defines a radius relative to the dimensions of the element's border box. |
| One value | Sets both the horizontal and vertical radii using the same specified value. |
| Two values | Sets the horizontal radius first and the vertical radius second. |
0 |
Removes rounding from the top-left corner. |
inherit |
Inherits the computed radii from the parent element. |
initial |
Resets both radii to zero. |
unset |
Resets both radii to zero because the property is not inherited. |
revert |
Reverts the property according to cascade origin rules. |
revert-layer |
Reverts the property according to cascade layer rules. |
Property Characteristics
| Characteristic | Value |
|---|---|
| Initial value | 0 |
| Inherited | No |
| Applies to | Elements that support border radius properties |
| Computed value | Two absolute lengths or percentages |
| Animation type | By computed value type |
| Accepted values | One or two non-negative lengths or percentages |
| Property type | Longhand |
| Physical corner | Top-left |
Negative values are invalid. The property also does not accept the slash syntax used by the border-radius shorthand.
How It Works
The browser uses the specified radii to replace the square top-left corner with a curved edge.
Step 1: Create an Element
<div class="panel">
This panel has a rounded top-left corner.
</div>
Step 2: Add Basic Styling
.panel {
padding: 24px;
background-color: #e7f3fc;
border: 3px solid #1769aa;
}
Step 3: Round the Corner
.panel {
border-top-left-radius: 30px;
}
The top-left corner becomes rounded while the other corners remain square.
Step 4: Create an Elliptical Corner
.panel {
border-top-left-radius: 60px 25px;
}
The corner becomes wider horizontally than vertically.
Step 5: Remove the Rounding
.panel {
border-top-left-radius: 0;
}
The top-left corner returns to a square shape.
Only the top-left corner is directly affected. The other three corners retain their existing radius values.
Circular Corners
A single length value defines equal horizontal and vertical radii, producing a circular corner.
Small Radius
.panel {
border-top-left-radius: 8px;
}
Medium Radius
.panel {
border-top-left-radius: 24px;
}
Large Radius
.panel {
border-top-left-radius: 60px;
}
Using rem Units
.panel {
border-top-left-radius: 2rem;
}
Using a Calculation
.panel {
border-top-left-radius: calc(12px + 1vw);
}
The final rendered radius may be reduced automatically if it would overlap with the radii of neighboring corners.
Use a single length value when you want a consistently circular curve at the top-left corner.
Elliptical Corners
Two values define an elliptical corner. The first specifies the horizontal radius, and the second specifies the vertical radius.
Wide Elliptical Corner
.panel {
border-top-left-radius: 80px 20px;
}
The corner extends farther along the top edge than along the left edge.
Tall Elliptical Corner
.panel {
border-top-left-radius: 20px 80px;
}
The corner extends farther down the left edge than along the top edge.
Equal Radii
.panel {
border-top-left-radius: 30px 30px;
}
Equal length radii produce a circular curve.
Mixed Length Units
.panel {
border-top-left-radius: 4rem 20px;
}
Length and Percentage
.panel {
border-top-left-radius: 50px 25%;
}
Zero Horizontal Radius
.panel {
border-top-left-radius: 0 40px;
}
If either radius is zero, the corner is not rounded.
Elliptical radii are useful for creating distinctive card shapes, banners, and decorative containers.
Percentage Values
Percentage radii are calculated relative to the dimensions of the element's border box.
The horizontal radius uses the border box width, while the vertical radius uses the border box height.
Single Percentage
.panel {
border-top-left-radius: 25%;
}
Both radii use 25%, but they are calculated against different dimensions.
Two Percentages
.panel {
border-top-left-radius: 50% 20%;
}
Mixed Percentage and Length
.panel {
border-top-left-radius: 30% 40px;
}
Half-Width and Half-Height Radii
.panel {
border-top-left-radius: 50%;
}
The horizontal radius is half the border box width, and the vertical radius is half its height.
Percentage With Fixed Dimensions
.panel {
width: 240px;
height: 120px;
border-top-left-radius: 25%;
}
Before any overlap scaling, the horizontal radius is 60 pixels and the vertical radius is 30 pixels.
Responsive Percentage Radius
.panel {
width: 100%;
min-height: 160px;
border-top-left-radius: 20%;
}
The radius adapts as the element's dimensions change.
Percentages are useful for proportional corner shapes, especially when the element's width or height changes responsively.
Length Units
The property supports CSS length units, including absolute and relative lengths.
Pixels
.panel {
border-top-left-radius: 24px;
}
rem Units
.panel {
border-top-left-radius: 2rem;
}
The radius is based on the root element's font size.
em Units
.panel {
border-top-left-radius: 2em;
}
The radius is based on the element's font size.
Viewport Units
.panel {
border-top-left-radius: 5vw;
}
Calculated Length
.panel {
border-top-left-radius: calc(16px + 1rem);
}
Clamped Length
.panel {
border-top-left-radius: clamp(12px, 4vw, 60px);
}
Two Different Units
.panel {
border-top-left-radius: 4rem 24px;
}
Choose units based on whether the radius should remain fixed, scale with typography, or respond to viewport dimensions.
border-radius Shorthand
The border-radius shorthand can set the radii of all four corners in one declaration.
One Value for All Corners
.panel {
border-radius: 20px;
}
All four corners receive the same radius.
Four Different Corners
.panel {
border-radius: 40px 20px 10px 5px;
}
The values apply clockwise: top-left, top-right, bottom-right, and bottom-left.
Only the Top-Left Corner
.panel {
border-radius: 40px 0 0 0;
}
This is equivalent to setting the top-left radius to 40 pixels and the other corners to zero.
Shorthand Followed by Longhand
.panel {
border-radius: 12px;
border-top-left-radius: 50px;
}
The top-left corner becomes 50 pixels, while the other corners remain 12 pixels.
Longhand Followed by Shorthand
.panel {
border-top-left-radius: 50px;
border-radius: 12px;
}
The later shorthand resets all four corners to 12 pixels.
Elliptical Shorthand
.panel {
border-radius: 40px 20px 10px 5px / 20px 10px 5px 2px;
}
The values before the slash define horizontal radii. The values after the slash define vertical radii.
Equivalent Longhand
.panel {
border-top-left-radius: 40px 20px;
}
The individual corner property uses two space-separated values, not slash syntax.
Use border-radius for multiple corners and border-top-left-radius when you need to control only the physical top-left corner.
Physical vs. Logical Corners
The border-top-left-radius property always targets the physical top-left corner.
Logical corner radius properties use the block and inline directions to determine which physical corner is affected.
Physical Top-Left Corner
.panel {
border-top-left-radius: 30px;
}
Logical Start-Start Corner
.panel {
border-start-start-radius: 30px;
}
The logical property rounds the corner where the block-start and inline-start edges meet.
Horizontal Left-to-Right Text
.panel {
writing-mode: horizontal-tb;
direction: ltr;
border-start-start-radius: 30px;
}
The logical start-start corner corresponds to the physical top-left corner.
Horizontal Right-to-Left Text
.panel {
writing-mode: horizontal-tb;
direction: rtl;
border-start-start-radius: 30px;
}
The logical start-start corner corresponds to the physical top-right corner.
Vertical Right-to-Left Writing Mode
.panel {
writing-mode: vertical-rl;
direction: ltr;
border-start-start-radius: 30px;
}
The logical start-start corner corresponds to the physical top-right corner.
Vertical Left-to-Right Writing Mode
.panel {
writing-mode: vertical-lr;
direction: ltr;
border-start-start-radius: 30px;
}
The logical start-start corner corresponds to the physical top-left corner.
Physical and Logical Conflict
.panel {
writing-mode: horizontal-tb;
direction: ltr;
border-top-left-radius: 20px;
border-start-start-radius: 50px;
}
Both declarations target the same physical corner in this writing mode and direction. The later declaration wins when cascade priority is otherwise equal.
Use physical corner properties for fixed visual placement and logical corner properties when the design should adapt to writing direction.
Backgrounds and Borders
The corner radius affects the shape of the element's background and border, even when the border itself is not visible.
Background Without a Border
.panel {
padding: 24px;
background-color: #e7f3fc;
border-top-left-radius: 40px;
}
The background follows the rounded corner without requiring a visible border.
Solid Border
.panel {
border: 4px solid #1769aa;
border-top-left-radius: 40px;
}
Thick Border
.panel {
border: 12px solid #1769aa;
border-top-left-radius: 50px;
}
The border follows the curved outer edge, with the inner curve adjusted for the border thickness.
Different Border Colors
.panel {
border: 5px solid #cccccc;
border-top-color: #1769aa;
border-left-color: #c04b37;
border-top-left-radius: 40px;
}
The top and left border colors meet along the rounded corner.
Gradient Background
.panel {
padding: 24px;
border-top-left-radius: 50px;
background: linear-gradient(135deg, #e7f3fc, #ffffff);
}
Background Clipping
.panel {
border: 8px solid rgb(23 105 170 / 50%);
border-top-left-radius: 40px;
background-color: #e7f3fc;
background-clip: padding-box;
}
The background is clipped to the padding box, while the border follows the rounded corner.
Border radius shapes the border and background painting areas but does not automatically clip all descendant content.
Content Clipping
Rounded corners affect an element's border and background, but descendant content may still extend beyond the rounded shape.
Rounded Container
.panel {
border-top-left-radius: 40px;
background-color: #e7f3fc;
}
The container's background is rounded, but a child element may still extend into the corner.
Clipping Descendant Content
.panel {
border-top-left-radius: 40px;
overflow: hidden;
}
The overflow setting clips descendant content to the container's padding edge, following the rounded corner where applicable.
Clipping an Image
<div class="image-card">
<img src="example.jpg" alt="Example image">
</div>
.image-card {
border-top-left-radius: 40px;
overflow: hidden;
}
.image-card img {
display: block;
width: 100%;
height: auto;
}
Rounding an Image Directly
.rounded-image {
border-top-left-radius: 40px;
}
Clipping With clip-path
.panel {
border-top-left-radius: 40px;
clip-path: inset(0 round 40px 0 0 0);
}
The clip-path declaration creates an additional clipping shape. Its radii must be kept consistent with the intended border radius.
Use overflow clipping when necessary, but remember that it can also clip shadows, positioned content, and other visual effects extending outside the container.
Radius Overlap and Scaling
CSS automatically reduces corner radii when their combined sizes would overlap along an edge.
Large Top Corner Radii
.panel {
width: 200px;
height: 120px;
border-top-left-radius: 150px;
border-top-right-radius: 150px;
}
The combined horizontal radii exceed the element's width. The browser scales the radii proportionally so they fit.
Large Vertical Radii
.panel {
width: 240px;
height: 100px;
border-top-left-radius: 40px 100px;
border-bottom-left-radius: 40px 100px;
}
The combined vertical radii exceed the element's height, so the browser scales the radii.
Oversized Single Corner
.panel {
width: 200px;
height: 100px;
border-top-left-radius: 300px;
}
The browser limits the rendered curve to fit the element's dimensions.
Percentage Radius
.panel {
width: 200px;
height: 100px;
border-top-left-radius: 75%;
}
The horizontal and vertical radii are calculated from the border box dimensions, then scaled if necessary.
The browser uses a common scaling factor to preserve the proportions of the specified corner radii.
This behavior prevents neighboring corner curves from overlapping and keeps the final border shape valid.
Cascade and Overrides
The CSS cascade determines which top-left radius applies when multiple declarations target the same element.
Later Declaration
.panel {
border-top-left-radius: 20px;
border-top-left-radius: 50px;
}
The later declaration wins when cascade priority is otherwise equal.
Higher Specificity
.panel {
border-top-left-radius: 20px;
}
.panel.featured {
border-top-left-radius: 60px;
}
Shorthand Override
.panel {
border-top-left-radius: 60px;
border-radius: 12px;
}
The later shorthand resets the top-left corner to 12 pixels.
Longhand Override
.panel {
border-radius: 12px;
border-top-left-radius: 60px;
}
The top-left corner becomes 60 pixels, while the other corners remain 12 pixels.
CSS Layers
@layer base, components;
@layer base {
.panel {
border-top-left-radius: 12px;
}
}
@layer components {
.panel {
border-top-left-radius: 40px;
}
}
For normal declarations, the later layer takes precedence.
Resetting the Radius
.panel {
border-top-left-radius: 40px;
}
.panel.square-corner {
border-top-left-radius: 0;
}
The reset class removes the top-left corner rounding.
When troubleshooting corner radii, inspect both border-top-left-radius and the broader border-radius shorthand.
CSS Custom Properties
Custom properties can store reusable corner radii and make component variations easier to maintain.
Shared Radius
:root {
--corner-radius: 30px;
}
.panel {
border-top-left-radius: var(--corner-radius);
}
Fallback Radius
.panel {
border-top-left-radius: var(--top-left-radius, 24px);
}
Component Variants
.card {
--corner-radius: 20px;
border-top-left-radius: var(--corner-radius);
}
.card.featured {
--corner-radius: 60px;
}
.card.compact {
--corner-radius: 8px;
}
Elliptical Radius Variables
.panel {
--radius-x: 60px;
--radius-y: 20px;
border-top-left-radius: var(--radius-x) var(--radius-y);
}
Calculated Radius
:root {
--base-radius: 12px;
}
.panel {
border-top-left-radius: calc(var(--base-radius) * 3);
}
Responsive Radius Variable
.panel {
--corner-radius: 40px;
border-top-left-radius: var(--corner-radius);
}
@media (max-width: 600px) {
.panel {
--corner-radius: 16px;
}
}
Custom properties help maintain consistent corner shapes across cards, panels, and other interface components.
Transitions and Animation
The border-top-left-radius property can animate between compatible radius values, creating smooth corner-shape transitions.
Hover Radius Transition
.panel {
border-top-left-radius: 12px;
transition: border-top-left-radius 0.3s ease;
}
.panel:hover {
border-top-left-radius: 60px;
}
Elliptical Transition
.panel {
border-top-left-radius: 20px 20px;
transition: border-top-left-radius 0.4s ease;
}
.panel:hover {
border-top-left-radius: 80px 30px;
}
Percentage Transition
.panel {
border-top-left-radius: 10%;
transition: border-top-left-radius 0.4s ease;
}
.panel:hover {
border-top-left-radius: 40%;
}
Keyframe Animation
@keyframes corner-shape {
0%, 100% {
border-top-left-radius: 10px;
}
50% {
border-top-left-radius: 80px 30px;
}
}
.animated-panel {
animation: corner-shape 3s ease-in-out infinite;
}
Selected State
.card {
border-top-left-radius: 16px;
transition: border-top-left-radius 0.3s ease;
}
.card.is-selected {
border-top-left-radius: 60px;
}
Reduced Motion Preference
.panel {
border-top-left-radius: 12px;
transition: border-top-left-radius 0.3s ease;
}
.panel:hover {
border-top-left-radius: 60px;
}
@media (prefers-reduced-motion: reduce) {
.panel {
transition: none;
}
}
Corner radius transitions change the shape of the element without directly changing its box dimensions, although the visible painted area changes.
Responsive Design
Corner radii can adapt to viewport width, container dimensions, and component size.
Media Query
.panel {
border-top-left-radius: 60px;
}
@media (max-width: 600px) {
.panel {
border-top-left-radius: 20px;
}
}
Container Query
.panel-container {
container-type: inline-size;
}
.panel {
border-top-left-radius: 16px;
}
@container (min-width: 500px) {
.panel {
border-top-left-radius: 60px;
}
}
Fluid Radius
.panel {
border-top-left-radius: clamp(12px, 5vw, 80px);
}
Percentage Radius
.panel {
border-top-left-radius: 25%;
}
The radius adapts to the element's border box dimensions.
Responsive Elliptical Radius
.panel {
border-top-left-radius: 80px 30px;
}
@media (max-width: 600px) {
.panel {
border-top-left-radius: 30px 15px;
}
}
Logical Corner Alternative
.panel {
border-start-start-radius: 30px;
}
The logical property follows the writing mode and text direction rather than always rounding the physical top-left corner.
Responsive radii can preserve a consistent visual style while adapting the curve to different component dimensions.
Practical Uses
The border-top-left-radius property is useful for asymmetrical cards, decorative panels, images, and interface accents.
Asymmetrical Card
.card {
padding: 24px;
background-color: #e7f3fc;
border-top-left-radius: 60px;
}
Featured Panel
.featured-panel {
padding: 24px;
border: 3px solid #1769aa;
border-top-left-radius: 80px 30px;
}
Rounded Image
.featured-image {
display: block;
max-width: 100%;
border-top-left-radius: 50px;
}
Decorative Banner
.banner {
padding: 30px;
background-color: #1769aa;
color: #ffffff;
border-top-left-radius: 100px 40px;
}
Notification Panel
.notification {
padding: 20px;
background-color: #fff8e8;
border-left: 5px solid #b7791f;
border-top-left-radius: 30px;
}
Rounded Table Container
.table-container {
border: 1px solid #cccccc;
border-top-left-radius: 20px;
overflow: hidden;
}
Custom Shape
.shape {
width: 200px;
height: 120px;
background-color: #1769aa;
border-top-left-radius: 100% 100%;
}
Hover Shape Change
.card {
border-top-left-radius: 16px;
transition: border-top-left-radius 0.3s ease;
}
.card:hover {
border-top-left-radius: 60px;
}
Individual corner radii allow you to create distinctive shapes without adding extra markup or image assets.
border-top-left-radius Example
The following example compares circular, elliptical, percentage-based, and square top-left corners.
<div class="border-top-left-radius-demo">
<div class="demo-box small">12px</div>
<div class="demo-box medium">30px</div>
<div class="demo-box large">60px</div>
<div class="demo-box wide">80px 20px</div>
<div class="demo-box tall">20px 70px</div>
<div class="demo-box percent">25%</div>
<div class="demo-box mixed">40% 20px</div>
<div class="demo-box square">0</div>
</div>
.border-top-left-radius-demo {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
gap: 20px;
}
.border-top-left-radius-demo .demo-box {
box-sizing: border-box;
min-height: 120px;
padding: 20px;
border: 3px solid #1769aa;
background-color: #e7f3fc;
color: #173b5e;
font-weight: bold;
text-align: center;
}
.border-top-left-radius-demo .small {
border-top-left-radius: 12px;
}
.border-top-left-radius-demo .medium {
border-top-left-radius: 30px;
}
.border-top-left-radius-demo .large {
border-top-left-radius: 60px;
}
.border-top-left-radius-demo .wide {
border-top-left-radius: 80px 20px;
}
.border-top-left-radius-demo .tall {
border-top-left-radius: 20px 70px;
}
.border-top-left-radius-demo .percent {
border-top-left-radius: 25%;
}
.border-top-left-radius-demo .mixed {
border-top-left-radius: 40% 20px;
}
.border-top-left-radius-demo .square {
border-top-left-radius: 0;
}
The first three examples use circular radii of increasing size. The wide and tall examples demonstrate elliptical curves.
The percentage examples scale with the element's dimensions, while the final example retains a square top-left corner.
Important Considerations
Keep the following points in mind when using border-top-left-radius:
- Purpose: Rounds the physical top-left corner of an element.
- Initial value:
0. - Inheritance: The property is not inherited.
- Accepted values: One or two non-negative lengths or percentages.
- Single value: Defines equal specified horizontal and vertical radii.
- Two values: Defines the horizontal radius first and the vertical radius second.
- Percentage values: Use border box width for horizontal radii and border box height for vertical radii.
- Negative values: Invalid.
- Zero radius: Produces a square corner.
- Physical corner: Always affects the top-left corner regardless of writing mode.
- Logical alternative: Use the appropriate logical corner radius property for writing-mode-aware layouts.
- Border requirement: A visible border is not required for the background to appear rounded.
- Content clipping: Descendant content is not automatically clipped to the rounded corner.
- Radius overlap: Browsers scale radii proportionally when necessary to prevent overlap.
- Shorthand interactions: A later
border-radiusshorthand can override the individual corner radius. - Slash syntax: Not supported by the individual corner property.
- Custom properties: Can store reusable radius values.
- Animation: Compatible radius values can interpolate smoothly.
- Browser support: The property is widely supported.
Use border-top-left-radius when you need to round one specific physical corner without changing the other three corners.
Browser Support
The border-top-left-radius property is widely available and supported in Chrome, Edge, Firefox, Safari, and other major browsers.
Modern browsers support circular and elliptical radii, percentage values, and transitions without requiring vendor prefixes.
.panel {
border-top-left-radius: 40px 20px;
}
This declaration is supported by modern browsers and rounds only the physical top-left corner.
For current compatibility details, visit Can I Use? and search for border-top-left-radius.
Specifications
The border-top-left-radius property is defined in the CSS Backgrounds and Borders Module Level 3 specification.
CSS Backgrounds and Borders Module Level 3
The specification defines circular and elliptical corner radii, percentage calculations, and the rules for scaling overlapping corner curves.
