CSS: border-top-left-radius property
This CSS tutorial explains how to use the CSS property called border-top-left-radius with syntax and examples.
Description
The CSS border-top-left-radius property defines rounded corners on the left side of the top border of a box.
Syntax
The syntax for the border-top-left-radius CSS property is:
border-top-left-radius: value;
Parameters or Arguments
- value
The radius value to apply to the left side of the top border of a box. It can be one of the following:
Value Description fixed Fixed value expressed in px, em, ...
div { border-top-left-radius: 3px; }percentage Percentage value
div { border-top-left-radius: 5%; }inherit Element will inherit the border-top-left-radius from its parent element
div { border-top-left-radius: inherit; }
Note
- See also the border-top-right-radius and border-radius properties.
Browser Compatibility
The CSS border-top-left-radius property has basic support with the following browsers:
- Chrome 4
- Firefox 4+ (Gecko 2+)
- Internet Explorer 9+ (IE 9+)
- Opera 10.5+
- Safari 5+ (WebKit 3+)
Example
We will discuss the border-top-left-radius property below, exploring examples of how to use this property in CSS.
Let's look at a CSS border-top-left-radius example where we provide a fixed value.
p { border-top-left-radius: 5px; border-top-style: solid; }
In this CSS border-top-left-radius example, we have defined rounded corners of 5px on the left side of the top border for the <p> tag. Be sure to apply a border-top-style so that the border appears.
Next, we'll look at a CSS border-top-left-radius example where we provide a percentage value.
p { border-top-left-radius: 12%; border-top-style: solid; }
In this CSS border-top-left-radius example, we have defined rounded corners of 12% to the left side of the top border.
Advertisements